Change KeyValues of an already spawned entity
How can I change the KeyValues of an already spawned entity. What I know is, I've never seen or tried this is the actual Source SDK Hammer Editor. Not sure if it is possible doing it with a script.
But how can I do it with SourceMod? Let's take this as an example: https://forums.alliedmods.net/showthread.php?t=288850 PHP Code:
Let's say I want to change the spread again. How can I do that? So what I know is I wouldn't be able to access the entity anymore by using the gunfire variable. I would need to get the entity first. But if I get the entity, how can I change the KeyValues then? |
Re: Change KeyValues of an already spawned entity
Save the entity in a global variable. Also, you should check if that entity has a netptop with "spread" in it ...
|
Re: Change KeyValues of an already spawned entity
KeyValues before dispatch of the entity will end up being translated to their associated netprops. This doesnt mean the KeyValue and netprop has the same name or data types.
As suggested by Ilusion9 and to expand. You want to use sm_dump_netprops from the server console. Find env_gunfire in your dump and find the associated netprob. |
Re: Change KeyValues of an already spawned entity
According to valve wiki, AddOutput supports 2 formats.
https://developer.valvesoftware.com/wiki/AddOutput But, it looks like that doesn't work when entity is already spawned. PHP Code:
|
Re: Change KeyValues of an already spawned entity
You would need to trigger it to execute
|
All times are GMT -4. The time now is 18:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.