PDA

View Full Version : logic_case


AnIHiL
10-13-2010, 11:42
I would like to change output delay in logic_case entity on map.

I checked in Hammer info about this logic_case:
- output: OnCase01
- target: counter_2_teleports
- input: Add
- parameter: 1
- delay: 2.00
- fire only once: no

Now I'm trying to change this delay to 10 seconds. I have now code:
new limit = GetMaxEntities();
new start = -1;
new entityy = -1;
new String:namee[150];
new String:addoutput[64];

while (start < limit)
{
entityy = FindEntityByClassname(start, "logic_case");

if (entityy == -1)
start = limit;
else
{
start = entityy;

GetEntPropString(entityy, Prop_Data, "m_iName", namee, sizeof(namee));

if (!strcmp(namee, "case_2_teleports"))
{
Format(addoutput, sizeof(addoutput), "OnCase01 counter_2_teleports:Add:1:%f:-1", 10.0);
SetVariantString(addoutput);
AcceptEntityInput(entityy, "AddOutput");
}
}
}I thought it would change existing output OnCase01 but I might be wrong. How can I change delay or how to delete output from entity than I may add my own one?

From documentation ( http://developer.valvesoftware.com/wiki/Logic_case ):
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>

thetwistedpanda
10-13-2010, 11:52
Just curious, have you looked into using Stripper: Source for this? Or is it not a possibility with what you want to do?

AnIHiL
10-13-2010, 11:57
Never heard about it. Thank you for information. (link: http://www.bailopan.net/stripper/ )

FaTony
10-13-2010, 12:00
Logic_case is non-networking entity, you'll need it's reference. Haven't worked with them, might be some quirks.

AnIHiL
10-13-2010, 12:03
So Stripper:Source won't work ?

thetwistedpanda
10-13-2010, 12:05
No Stripper:Source will, you'll just need to do whatever you need to before the map loads (when Stripper does it's thing). If you need to modify it later, then you'll need what FaTony suggested.

AnIHiL
10-13-2010, 12:09
I want to set delay only once. Don't need to change it again in game so Stripper:Source should be fine to do this.