Raised This Month: $51 Target: $400
 12% 

Read entity outputs or map .ent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-07-2011 , 06:53   Read entity outputs or map .ent
Reply With Quote #1

I just want to know if its possible to read/copy the outputs from an entity or at least read the .ent file theres in the map (.bsp) file, an example would be good

This is from cp_dustbowl's .ent file

Code:
{
"model" "*20"
"team_numcap_3" "1"
"team_numcap_2" "1"
"team_cancap_3" "1"
"team_cancap_2" "0"
"StartDisabled" "0"
"area_time_to_cap" "3"
"area_cap_point" "cap_red_2"
"classname" "trigger_capture_area"
"hammerid" "4211432"
"OnCapTeam2" "start_timer,AddTime,270,0.01,-1"
"OnCapTeam2" "cap1_stairs,Disable,,15,-1"
"OnCapTeam2" "cap1_fence_brush,Enable,,15,-1"
"OnCapTeam2" "cap1_fence,EnableCollision,,15.1,-1"
"OnCapTeam2" "cap1_fence,Enable,,15,-1"
"OnCapTeam2" "gate_2nd_spawn,Disable,,15,-1"
"OnCapTeam2" "sign_cap_2,Skin,2,0,-1"
"OnCapTeam2" "sign_resupply_1,Skin,4,0,-1"
"OnCapTeam2" "cap_2,Skin,2,0,-1"
"OnCapTeam2" "sign_blue_round1,TurnOff,,0,-1"
"OnCapTeam2" "cap2_signs,TurnOn,,15,-1"
"OnCapTeam2" "cap2_signs,EnableCollision,,15,-1"
"OnCapTeam2" "area2_camera,Enable,,15,-1"
"OnCapTeam2" "cap1_fence_block,TurnOff,,15,-1"
}
And i would like to copy the "OnCapTeam2" to E.G. OnUser2, else i would probably have to add some of keyvalue system to get multistage maps working with Bomb Fortress
Cookies.net is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-07-2011 , 07:07   Re: Read entity outputs or map .ent
Reply With Quote #2

SDKHooks has a hook that passes the ents as string file as parameter: OnLevelInit(), I'm not sure if it's working.

and yes, it's possible to hook entity outputs:

http://docs.sourcemod.net/api/index....ad=file&id=51&
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-07-2011 , 07:31   Re: Read entity outputs or map .ent
Reply With Quote #3

Quote:
Originally Posted by berni View Post
SDKHooks has a hook that passes the ents as string file as parameter: OnLevelInit(), I'm not sure if it's working.

and yes, it's possible to hook entity outputs:

http://docs.sourcemod.net/api/index....ad=file&id=51&
Not hooking, reading E.G. on mapstart find all trigger_capture_area, reading all the outputs like "start_timer,AddTime,270,0.01,-1" or "OnCapTeam2" "cap1_fence_block,TurnOff,,15,-1" and then put that into OnUser(x) and then FireUser(x)
Cookies.net is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-07-2011 , 08:13   Re: Read entity outputs or map .ent
Reply With Quote #4

Sourcemod currently provides no way of reading those output actions.

However you can find the trigger_capture_area entity, hook it outputs, and send your own inputs like AddTime, TurnOff etc...
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-07-2011 , 08:53   Re: Read entity outputs or map .ent
Reply With Quote #5

Quote:
Originally Posted by berni View Post
Sourcemod currently provides no way of reading those output actions.

However you can find the trigger_capture_area entity, hook it outputs, and send your own inputs like AddTime, TurnOff etc...
But i need to get those from outputs, ill try and see what i can do with OnLevelInit, but apparently i just cant change OnCapTeam2 to OnUser2 and return plugin_changed so i will have to find another way

edit: It seems OnLevelInit doesnt work

Last edited by Cookies.net; 02-07-2011 at 11:26.
Cookies.net is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode