Scripted trigger

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Firefox
Colour Sergeant
Posts: 90
Joined: Sun May 07, 2006 3:23 pm
Location: USA
Contact:

Scripted trigger

Post 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?
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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
User avatar
Firefox
Colour Sergeant
Posts: 90
Joined: Sun May 07, 2006 3:23 pm
Location: USA
Contact:

Post 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?
User avatar
Axion
Major General
Posts: 683
Joined: Mon Sep 29, 2003 5:14 am
Location: Northern California
Contact:

Post 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:
"The work of a thousand years is nothing but rubble."
- Dr. Carl Goerdeler (1943)
Visit my mapping site: http://www.freewebs.com/axion9
Image
User avatar
Firefox
Colour Sergeant
Posts: 90
Joined: Sun May 07, 2006 3:23 pm
Location: USA
Contact:

Post by Firefox »

nope, your posts are understandible :wink: thanks for your help!
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

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