trigger once

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

trigger once

Post 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
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Image
Post Reply