Entity output parameter truncated?
Hi,
I'm writing a plugin for Insurgency. On many maps, there are cash registers (prop_dynamic) which react to damage by making a "ding!" noise, emitting sparks, and popping open the cash drawer. It appears that this is implemented using the entity I/O system. I used Hammer to look at the entity outputs: Code:
Output Target Target input Parameter Delay Only once I'm attempting to add more outputs to make the register reset itself after a few seconds. This is what I have so far: PHP Code:
The problem I'm having is that although the first two steps work properly (sparks fly, drawer opens, drawer closes), the re-add of the OnTakeDamage output fails. I ran my server in developer mode (passing -dev on the command line) and looked at the output. I can see my script adding the outputs: Code:
(1.02) input <NULL>: prop_dynamic.AddOutput(OnTakeDamage !self,FireUser4,,0.0,1) Code:
(62.91) output: (prop_dynamic,) -> (!self,FireUser4)() Code:
(62.91) output: (prop_dynamic,) -> (!self,AddOutput)(OnTakeDamage !self) Does anyone have insight as to why this is not working? |
Re: Entity output parameter truncated?
AddOutputs are separated by colons, not commas to seperate other outputs
https://developer.valvesoftware.com/wiki/AddOutput Try This: Code:
SetVariantString("OnTakeDamage !self:FireUser4::0.0:1"); // Only once = yes |
Re: Entity output parameter truncated?
I tried the code you suggested, but still come up with the same result:
Code:
(23.88) output: (prop_dynamic,) -> (!self,FireUser4)() However, the third step's parameter is truncated as before. |
Re: Entity output parameter truncated?
Is the truncation happening specifically due to the colon, or is there a max size or something?
|
Re: Entity output parameter truncated?
You’ve got Unicode “fancy” quotes in that snippet which won’t be helping at all.
|
Re: Entity output parameter truncated?
Quote:
|
Re: Entity output parameter truncated?
Looking at the SDK code, it doesn't look like it is possible to do this - there is definitely no parsing for quoted strings at all.
AddOutput replaces all colons in the string input with commas indiscriminately, and the parameter override parsing code doesn't have any way to handle parameters containing commas. Since you're writing a plugin anyway, I suggest replacing all this garbage with an OnTakeDamage hook and a couple of timers. EDIT: You could also use https://forums.alliedmods.net/showthread.php?t=305343 to add the output actions directly, as the problem is in how the AddOutput input parses things. |
Re: Entity output parameter truncated?
Thanks for the info. I already had the behavior I wanted implemented with the OnTakeDamage hook. I figured the I/O stuff would be more elegant. Too bad it's broken in this use case.
|
Re: Entity output parameter truncated?
Create a point_template entity and link the entities you want to respawn to it. The point_template entity will allow you to respawn the template via an input.
https://developer.valvesoftware.com/wiki/Point_template |
All times are GMT -4. The time now is 18:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.