How do I script a bomb timer?
Moderator: Moderators
How do I script a bomb timer?
Hello. How do I script a bomb timer, and when I press the use key button, the trigger_use triggers off the bomb?
I assume you'd just want to use the global Mohaa script for this purpose, global/obj_dm.scr? Here's how to use it, at least, that's what I think you should do when I'm reading through that script file. Somebody else might have more detailed info.
As I think it should be, you need to create a script_model in MOHRadiant where you want your bomb to be placed. Give it a targetname of for example 'bomb'. If you want your bomb to destroy a model, target the script_model to the model that has to be destroyed. Then add a key $destroyed_model value <filename of destroyed model .tik> to the destroyable model. If you want, you may target the destroyable model to a collision mask.
Then create a small trigger_use near the bomb. Targetname it something like 'bomb_trigger'.
Finally, reselect the script_model where the bomb should be placed and add the following keys / values:
Gee that's been a long story
. Hope it works and I'm not talking crap
.
As I think it should be, you need to create a script_model in MOHRadiant where you want your bomb to be placed. Give it a targetname of for example 'bomb'. If you want your bomb to destroy a model, target the script_model to the model that has to be destroyed. Then add a key $destroyed_model value <filename of destroyed model .tik> to the destroyable model. If you want, you may target the destroyable model to a collision mask.
Then create a small trigger_use near the bomb. Targetname it something like 'bomb_trigger'.
Finally, reselect the script_model where the bomb should be placed and add the following keys / values:
- key / value
$trigger_name / targetname of the trigger_use
#exploder_set / #set value of a optional group of exploders to activate
$explosion_fx / filename of an explosion effect to spawn
$explosion_sound / sound alias to use for explosion
$killarea / optionally set this to a non-solid script_object
Code: Select all
level waittill spawn
level.defusing_team = "axis"
level.planting_team = "allies"
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0 -> 1 means respawn, 0 is roundbased
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw -> axis win when timelimit is hit
level waittill roundstart
// waittill there is at least one allied and an axis player
$bomb thread global/obj_dm.scr::bomb_thinker
// where 'bomb' is the targetname of the script_model bomb
Yes you can.
Just create a trigger_use, and set 'setthread' to something like 'bomb'.
Then create a thread 'bomb:' in your script. Something like this should work:
Just create a trigger_use, and set 'setthread' to something like 'bomb'.
Then create a thread 'bomb:' in your script. Something like this should work:
Code: Select all
bomb:
$player stopwatch 5
wait 5
// explosion code here
endDepends on what kind of explosion you want. If you're using the global/exploders.scr file, it would just be:
Where '1' is the #set of the exploder group. If you don't want to use that script it's going to be a little more complicated.
Code: Select all
thread global/exploders.scr::explode 1