Page 1 of 1

Scripted trigger

Posted: Tue Jun 06, 2006 8:01 pm
by Firefox
How do I make it so that when you press the use key at a trigger it starts a command on my script?

Posted: Tue Jun 06, 2006 8:35 pm
by ViPER
try a use trigger

like this

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
}

end

Posted: Tue Jun 06, 2006 9:51 pm
by Firefox
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?

Posted: Tue Jun 06, 2006 10:25 pm
by Axion
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?
If 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.

I hope that made sense. It's been a little while since I've posted, and I might be rusty. :wink:

Posted: Tue Jun 06, 2006 10:34 pm
by Firefox
nope, your posts are understandible :wink: thanks for your help!

Posted: Wed Jun 07, 2006 3:53 am
by Green Beret
While your in the trigger properties, Instead of the
key/value target my_use_trigger_thread
enter in the key/value
key:setthread
value:my_triggers_thread

Then in your .scr make a thread

my_triggers_thread:
//script