as much as 1 of the most basics how do u make a shooter>rocket shot after 30 seconds
the shooter is been activated by panal/button
i searched yet didnt find my answer anyone help
also tryed func_timer didnt work so well
as much as 1 of the most basics how do u make a shooter>rocket shot after 30 seconds
the shooter is been activated by panal/button
i searched yet didnt find my answer anyone help
also tryed func_timer didnt work so well
set ur button to activate a section of your script
wait 30000
alertentity “the scriptname of your shooter”
Yes, it should work. 30000 = 30 sec.
I would do it like this:
Make a button. Give it the key ‘target’ and the value ‘tst_shooter’.
Insert a target_script_trigger. Give it the following keys/values:
Key ‘scriptname’ and value ‘tst_shooter’.
Key ‘targetname’ and value ‘tst_shooter’.
Key ‘target’ and the value ‘action’.
Insert a shooter:
Key ‘scriptname’ and the value 'nameofshooterentity ’
Key ‘targetname’ and the value 'nameofshooterentity ’
Write a script, something like this:
game_manager
{
spawn
{
//Accums
accum 1 set 0 // Shooter is active? 0 = No. 1 = Yes.
} // End spawn
} // End game_manager bracket.
tst_shooter // The scriptname of the target_script_trigger
{
spawn
{
wait 50 // This is just something I put in because many others do it.
}
// Inside the target_script_trigger there is a key ‘target’ with the value ‘action’.
// This is the script for that.
trigger action
{
accum 1 abort_if_equal 1 // Will abort script if shooter is active (i.e. 1 = Yes).
accum 1 set 1 // Accum 1 is temporarely set to 1.
alertentity nameofshooterentity // BOOOM!
wait 30000 // approximately 30 seconds.
accum 1 set 0 // Accum 1 is restored to its original value.
// It is now possible to fire the shooter again.
}
}
i’d like to set this right for posterity, i got the biggest headache tryin to make this work and it’s because you need a global accum for the active shooter
… or move the line:
accum 1 set 0 // Shooter is active? 0 = No. 1 = Yes.
into the spawn event-handler code of the tst_shooter…
Only the tst_shooter entity needs to know if the shooter is allready active or not…