Scripted trigger
Posted: Tue Jun 06, 2006 8:01 pm
How do I make it so that when you press the use key at a trigger it starts a command on my script?
Code: Select all
my_use_trigger_thread:
local.usetrg = spawn trigger_use
local.usetrg.origin = ( x x x ) //put coordinates here
local.usetrg setsize ( -x -x -x ) ( x x x ) // set size of trigger here
local.usetrg targetname usetrg
while(1)
{
$usetrg waittill trigger
//do stuff here
}
endIf you want a trigger to create its own thread in your script, you can give it a key/value of setthread/name of your thread. For example, if you had a trigger_use to open a door and you wanted to script conditions on how and when the door should open, you could give your trigger a key/value of setthread/door_conditions. Then in your script, you would make a thread called door_conditions that would contain the scripting that would control the door.Firefox wrote:Is there a ommand in radient (on the trigger) to link to a script line in the script?
or do i just right in
target my_use_trigger_thread
for the script above?