Page 1 of 1

trigger help

Posted: Fri Aug 19, 2005 5:20 pm
by JUDGE
ive made a trigger_multiple which i want to use more than once its set
off by gun fire but it only works once any1 tell me how to make this
work more than once?
classname trigger_multiple
health 10
spawnflags 128
targetname fight_trigger1
target fight_speaker

Posted: Fri Aug 19, 2005 5:40 pm
by ViPER
did u thread your waittill trigger in a while loop

While(1)
{
$fight_trigger1 waittill trigger
//do this stuff
}

health

Posted: Fri Aug 19, 2005 5:41 pm
by tltrude
Giving it health makes it die when the health goes to 0. However, you could spawn a new trigger with the same name, after the old one is killed.

spawn trigger_multiple "targetname" "fight_trigger1" "health" "10"
$fight_trigger1.origin = ( 0 0 0 )
$fight_trigger1 setsize ( -27 -38 0) (27 38 49)


The origin coordinates will have to be set to the same as the old trigger, or you can put in a script origin (that does not die) and use its .origin for the trigger's origin.

$fight_trigger1.origin = $trig_spot.orgin

Setsize is two xyz points on the corners of the trigger--as messured from its origin.

Posted: Fri Aug 19, 2005 5:55 pm
by JUDGE
is there any other ways of making a trigger which is set of by gun fire but
can be used more than once without scripting?

Nope

Posted: Fri Aug 19, 2005 6:06 pm
by tltrude
No, because like I said, the trigger dies.

But, scripting triggers is not that hard. Here is an example of three crates that explode and respawn after 20 seconds.

Code: Select all

main:
	level waittill prespawn

	thread boomcrate ( -680 -3160 38 ) (0 0 90) // origin and angles 
	thread boomcrate ( -144 -3160 0 ) (0 90 0) // origin and angles
	thread boomcrate ( 480 -3160 23 ) (90 0 0) // origin and angles  

	level waittill spawn

end


//------------------------------------------------> 
// EXPLOSIVE CRATE SPAWN THREAD 
//------------------------------------------------> 

boomcrate local.origin local.angles: 

   local.crate = spawn script_model 
   local.crate model "models/static/indycrate.tik" 
   local.crate.origin = local.origin + ( 0 0 -64 )
   local.crate.angles = local.angles
   local.crate time 0.001
   local.crate moveUp 64
   local.crate move 
   local.trigger = spawn trigger_multiple "spawnflags" "128" "health" "1" 
   local.trigger.origin = local.origin 
   local.trigger setsize ( -27 -38 0) (27 38 49)
   local.trigger.rotatedbbox = 1 
   local.trigger.angles = local.angles 

   local.trigger waittill trigger 

   exec global/model.scr local.origin // default is explosion mine 
   radiusdamage (local.origin + ( 0 0 64)) 250 256 // numbers are damage and radius 
   local.crate remove 
   wait 20 
   thread boomcrate local.origin local.angles

end
The crate pops up out of the ground to prevent players being trapped by the new crate.

Posted: Fri Aug 19, 2005 6:08 pm
by JUDGE
ah nice 1 tltrude why didnt i think of that ill look in ya altervator map
u got respawning crates in there
thanx m8 :D
to tell u truth i did try and use the test_pointer map with the finger but failed me script was all over the place so i started fresh with these triggers
i was going to use the number pad like this
http://i2.photobucket.com/albums/y6/cbc ... ot0040.jpg
tltrude any chance i could get the script for the testpointer to work with this then i could use the finger ie what target would be called i stand in etc...?

Posted: Sat Aug 20, 2005 8:11 am
by bdbodger
Just don't give the trigger health and it won't go away .

Posted: Sat Aug 20, 2005 5:33 pm
by JUDGE
well the trigger dont go away coz the trigger aint there or doesnt work no more oops :cry: