Page 1 of 1
delayed trigger
Posted: Mon Jul 09, 2007 8:38 pm
by ernst
hey guys, im looking to create a trigger with a delay so that when a player enters an area after 30 seconds the visible explosive boxes explode thus killing the player and all around him....
able to spawn the trigger but not sure how to delay it and create the explosion any ideas?
Posted: Mon Jul 09, 2007 9:34 pm
by Ophisâ„¢
im guessing,
Create a trigger_multiple and then make it a set thread.
make a thread in your script for the trigger to point to and the first command in the script could just simply be "wait 10" so this sets the script off but makes it wait for 10 before it carrys on with the exploding bit of the thread.... some one else will have to help you with that though.
Posted: Tue Jul 10, 2007 12:40 am
by ViPER
What if the player leaves before 30 seconds? u still want to kill him or just whos in the room?
Posted: Tue Jul 10, 2007 2:54 am
by erick
If the player left before 30 seconds you could just add something like this to the script to make sure he's still there
wait 30 // is in the original script
if ($player isTouching $it)
{
kill or whatever you want
}
else
{
nothing
}
delay
Posted: Tue Jul 10, 2007 3:33 am
by tltrude
Here is how I did exploding crates.
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
// add your wait line here
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 //this line makes it spawn again
end
The crate pops up out of the ground when it spawns -- so it wont trap a player on the spot. The trigger is set to fire when someone shoots it. So, you'll have to change it to "delay" "30" and make the setsize bigger. The lines in prespawn run the thread three time at three locations and with three different angles. So, it is really making three exploding crates with one thread.
Posted: Tue Jul 10, 2007 10:32 pm
by ernst
thanks tltrude i am acutally using your script in another part of the map...i had set the delay but the boxes werent exploding after 30 secs, i did change the set size but had to take out the spawn flags and health to get them to explode when the player is near, i think im close but hte delay just isnt working here is what i have
Code: Select all
thread boomcrate ( 1148.338 177.125 282.025 ) angle ( 267.572 )
thread boomcrate ( 1030.530 177.125 274.000 ) angle ( 290.781 )
thread boomcrate ( 754.613 167.125 273.885 ) angle ( 246.028 )
thread boomcrate ( 633.886 167.125 276.620 ) angle ( 266.885 )
thread boomcrate ( 299.086 172.374 288.076 ) angle ( 278.762 )
thread boomcrate ( 173.317 194.141 298.210 ) angle ( 296.856 )
thread boomcrate ( 36.845 217.756 319.637 ) angle ( 232.630 )
thread boomcrate ( -75.959 237.267 322.111 ) angle ( 280.558 )
thread boomcrate ( -452.735 186.851 341.745 ) angle ( 223.649 )
thread boomcrate ( -640.467 153.755 326.996 ) angle ( 350.447 )
thread boomcrate ( -549.705 169.753 334.699 ) angle ( 2.049 )
thread boomcrate ( -719.722 143.807 333.555 ) angle ( 287.463 )
level waittill spawn
thread random_explode_setup
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.angle = local.angle
local.crate time 0.001
local.crate moveUp 64
local.crate move
delay 30
local.trigger = spawn trigger_multiple
local.trigger.origin = local.origin
local.trigger setsize ( -200 -300 0) (200 300 49)
local.trigger.rotatedbbox = 1
local.trigger.angle = local.angle
local.trigger waittill trigger
exec global/model.scr local.origin // default is explosion mine
radiusdamage (local.origin + ( 0 0 64)) 250 500 // numbers are damage and radius
local.crate remove
wait 20
thread boomcrate local.origin local.angle
end
delay
Posted: Wed Jul 11, 2007 3:02 am
by tltrude
I would take out that delay line and put a wait line below the trigger waittill line.
local.trigger waittill trigger // the script waits here untill the trigger is touched.
wait 30
The delay for spawning a new crate is at the bottom of the thread (wait 20).
Ps: Maybe you should put in a "click sound", so the player has a chance to run away.
local.trigger waittill trigger
local.crate playsound mine_trigger
wait 30
I would be suprised if your "angle" things work because the word "angle" will end up being the "local.angles" variable -- instead of the numbers. Also you have "local.angles" in the thread name and "local.angle" in the thread. "angle" and "angles" are not the same thing because "angles" needs three ( x y and z axis) numbers to work. "angle" only takes one number (the y axis).
If you just want to use "angle", then change these lines.
thread boomcrate ( -549.705 169.753 334.699 ) ( 2.049 )
And this line.
boomcrate local.origin local.angle:
Posted: Wed Jul 11, 2007 8:46 pm
by ernst
Thank you so much! It works perfectly! the whole idea behind this was to limit the time on omaha beach, that the axis spent in the pillbox's and this is simulating allies planting explosives in there for them hehehe...thanks again, i really appreciate it!