trigger help

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
JUDGE
Corporal
Posts: 38
Joined: Thu Nov 25, 2004 9:46 pm
Location: UK
Contact:

trigger help

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

Post by ViPER »

did u thread your waittill trigger in a while loop

While(1)
{
$fight_trigger1 waittill trigger
//do this stuff
}
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

health

Post 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.
Last edited by tltrude on Fri Aug 19, 2005 5:55 pm, edited 1 time in total.
Tom Trude,

Image
JUDGE
Corporal
Posts: 38
Joined: Thu Nov 25, 2004 9:46 pm
Location: UK
Contact:

Post 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?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Nope

Post 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.
Last edited by tltrude on Fri Aug 19, 2005 6:12 pm, edited 2 times in total.
Tom Trude,

Image
JUDGE
Corporal
Posts: 38
Joined: Thu Nov 25, 2004 9:46 pm
Location: UK
Contact:

Post 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...?
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Just don't give the trigger health and it won't go away .
Image
JUDGE
Corporal
Posts: 38
Joined: Thu Nov 25, 2004 9:46 pm
Location: UK
Contact:

Post by JUDGE »

well the trigger dont go away coz the trigger aint there or doesnt work no more oops :cry:
Image
Post Reply