Page 1 of 1
trigger once
Posted: Mon Sep 12, 2005 8:02 pm
by ViPER
How do you get a trigger to trigger just once ?
I want it to trigger once each time a player runs into it but every thing i do just keeps triggering as long as the player is in the trgger area or just works once and not for the next player.
cant be use
Posted: Mon Sep 12, 2005 8:06 pm
by Rookie One.pl
Use a trigger_once entity (it's exactly the same as trigger_multiple but gets removed after it's triggered) or execute the nottriggerable command on it after it gets triggered. The triggerable command makes it usable again.
Example:
Code: Select all
trigger_triggered:
self nottriggerable // disable the trigger
wait 5
self triggerable // enable the trigger again after 5 secs
Posted: Mon Sep 12, 2005 8:29 pm
by ViPER
trigger once wont do it - but if i use this not triggerable thing it will still trigger 5 sec later if the player still there right?
i want to send one local message to each player every time they enter.
maybe theres another way?
Posted: Mon Sep 12, 2005 9:07 pm
by lizardkid
or, place this key/value in the trigger's fields.
cnt / 1
cnt defines how many times the trigger will go off before it removes itself. trgger_once is more conventional, however.
Posted: Tue Sep 13, 2005 8:17 am
by bdbodger
If you want to do it while a player in in the trigger , I mean for another player you can do it like this assumeing the thread is run by setting the setthread key on the trigger
trigger_thread:
local.player = parm.other
if(local.player.intrigger != NIL)
end
local.player.intrigger = 1
// do your stuff here
while(local.player istouching self)
waitframe
local.player.intrigger = NIL
end
Also you can set a wait on the trigger
"wait" ( Float wait_time ) Set the wait time (time between triggerings) for this trigger