Raised This Month: $ Target: $400
 0% 

SourceMod and Mapping - Controlling entities in the map?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
404UserNotFound
BANNED
Join Date: Dec 2011
Old 08-22-2015 , 13:23   SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #1

So I'm currently designing a new map for my server and I want to integrate some SourceMod functionality into the map. Essentially, I want to be able to search for specific in-map entities, then target specific copies of those entities based on their name (i.e. "func_respawnroom" named "thisisatest") and then change values of those entities (such as the "team" value of func_respawnroom).

Obviously I can look to Dr. McKay's No Enemy in Spawn plugin as an example of how to hook into the entity and all that fun stuff, but how would I go about targetting the entity based on name?

Also, I frequently check the Valve Developer Wiki for entity keyvalues, but when it comes to putting that info on keyvalues to use in a plugin, I find that to be hard as for example, the VDW shows this:

Quote:
SetTeam <integer>
Changes the entity's team.
But in the plugin, it's seen as GetEntProp(entity, Prop_Send, "m_iTeamNum");

And that confuses me. Would there happen to be a resource somewhere that lists entities and how to target the various entprops/keyvalues in a plugin?
404UserNotFound is offline
SoulSharD
Member
Join Date: Oct 2013
Location: United Kingdom
Old 08-22-2015 , 13:48   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #2

Dumping the datamaps and netprops will show all the props you can use on that entity.
It also displays the keyvalue equivalent of that prop. For example:

m_iInitialTeamNum (Save|Key|Input)(4 Bytes) - TeamNum

You can use either m_iInitialTeamNum when setting/getting ent props.
Or use TeamNum when using DispatchKeyValue() (or AddOutput)

sm_dump_datamaps <path.txt>
sm_dump_netprops <path.txt>


I apologize if I misunderstood you.
__________________

SoulSharD is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 08-22-2015 , 13:58   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #3

Quote:
Originally Posted by SoulSharD View Post
Dumping the datamaps and netprops will show all the props you can use on that entity.
It also displays the keyvalue equivalent of that prop. For example:

m_iInitialTeamNum (Save|Key|Input)(4 Bytes) - TeamNum

You can use either m_iInitialTeamNum when setting/getting ent props.
Or use TeamNum when using DispatchKeyValue() (or AddOutput)

sm_dump_datamaps <path.txt>
sm_dump_netprops <path.txt>


I apologize if I misunderstood you.
Quite alright, you provided great info. I'm guessing that dumping netprops should show me the netprop to use to check the entity's set name?
404UserNotFound is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-22-2015 , 13:59   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #4

m_iName is targetname

also SetTeam is an input, not a keyvalue
Miu is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 08-23-2015 , 19:09   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #5

Quote:
Originally Posted by Miu View Post
m_iName is targetname

also SetTeam is an input, not a keyvalue
Perfect! Now I can mess around with activating things.

One of the things I'm trying to do is recreate the rotating posters in Half Life: Source and Black Mesa but func_rotating entities don't work in TF2. Luckily I can rotate props and such like in the Do The Twist plugin, so I can just target specifically named entities and cause them to rotate via a plugin.
404UserNotFound is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-24-2015 , 03:36   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #6

Have you seen vscripts?

https://developer.valvesoftware.com/wiki/VScript
__________________
Neuro Toxin is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 08-24-2015 , 14:07   Re: SourceMod and Mapping - Controlling entities in the map?
Reply With Quote #7

Quote:
Originally Posted by Neuro Toxin View Post
Nothing listed there for TF2. And I like my method

Plus I don't know any of the supported languages except for Lua (which I know very little about, I mean I can modify DarkRP stuff but I can't do shit-all-else)

Last edited by 404UserNotFound; 08-24-2015 at 14:09.
404UserNotFound 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 11:25.


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