help needed setting a mutiple trigger flag


(MadMaximus) #1

ok, here’s my problem. I have a camera i made out of brush’s that hangs from a ceiling and watches an area with a trigger_multiple, what i’d like to do is have that so when an allied team member steps into that area, an alarm will go off, but when he leaves the trigger area it stops. I know it can be done because thats how the tanks get activated, they have a trigger_multiple thats targets a target_script_trigger to enable, and a func_timer targeting a target_script_trigger to disable.

but what i don’t understand is the process of how that works, i mean if the func_timer is firing every 1 second and the trigger_multiple is firing every .5, they would conflict with each other in the script, if your standing in the trigger area, it would be on/off on/off ect… ive checked the ldr and the goldrush script to see how it’s done, but it confuses me, can someone explain how it’s done? anyhelp would be appreciated.


(Mean Mr. Mustard) #2

ok, I’ll try to explain it…

The trigger_multiple ‘targets’ one of the target_script_trigger (truck_enabler in goldrush) When a player steps in the trigger, the target_script_trigger is activated and executes it’s ‘target key’ script routine (truck_enabler run in goldrush) For you, you’d actiavte the alarm here.

Now, the func_timer targets another target_script_trigger (truck_disabler). You then use the ‘target key’ of this entity to execute a script routine to track time. (say accum 0 inc 1)

Then if a player is outside the trigger_multiple for a certain length of time, you shut off the alarm. Don’t forget to reset the ‘timer’ each time a player enters the trigger_multiple


(MadMaximus) #3

ok, thats starting to makes sense, ive seen accum 4 in there as the counter on the disabler, but didn’t know what it was meant for… i tried counting and running through the script as it would, but i got all confused and lost. i’ll try some sample tests to see how it works. thanks greatly. :clap:

er… but don’t run off to far, i may get confused again and have need of more assistance :bump:


(MadMaximus) #4

just tested it, i see now… when u step into that trigger at .5 setting briefly and step out, it counts from 0 to whatever ( under 4 ) but if your in it for a while and step out, it continues to count to a maximum of 4… so thats why they set the counter at 4 before it resets.

excellent stuff! just need some accum’s as flags now so the siren starts and doesn’t restart until it’s reset.

thats Mean Mr. Mustard, your not so mean!

:drink:


(Drakir) #5

The way i would do it, offcourse the easy way :smiley:

Make a trigger_multiple that targets a target_speaker.
Set the delay on the trigger_multiple to the same amount of seconds the sound plays.

like /world/alarm_01 that plays for 2 seconds use a wait of 2…when the player steps into the trigger_multiple it will play again and again.
When he steps out it will stop when the sound has played its seconds.


(MadMaximus) #6

yeah, that would work also. but i did need to know how to do it with the func_timer cause now im thinking of making that ceiling camera a script mover that turns to the left and right, so i would need it so that if it saw u, it would stop.

i got it to work now, that multiple flag setting. =)