Home   Help Search Login Register  

Author Topic: Respawn names?  (Read 1396 times)

0 Members and 1 Guest are viewing this topic.

oWn

  • Guest
Respawn names?
« on: 14 Mar 2005, 10:00:16 »
Ok, this is how it is...

i have a suicide script with make the soldier explode on death, I've tried to make this work with respawned soldiers to, but is is wath happend:

dude1 dies, explodes as he shoud.
X sec later he respawn. but instead dude1s corpse explodes time after time. (with 15 sec delay ~15)

Now. how to make the new dude1 explode instead?

 The script (made orgilany by Armstrong):
________________________

_bomber = _this select 0
_target = _this select 1
_distance = _this select 2
_remove = _this select 3
_combatmode = _this select 4

#start

_bomber setcombatmode "_combatmode"
_bomber setspeedmode "full"
_bomber setunitpos "UP"

~0.001

? hoppaiplasket=_remove : removeallweapons _bomber

#over

_bomber commandmove getpos _target

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"

~0.1

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"

~0.1

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"

~0.1

goto "over"

#booom

bomb="heat120" camcreate getpos _bomber
bomb="shell120" camcreate getpos _bomber

~15

goto "start"

exit
___________
« Last Edit: 14 Mar 2005, 10:04:54 by oWn »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Respawn names?
« Reply #1 on: 14 Mar 2005, 21:37:47 »
Ok, this is how it is...

i have a suicide script with make the soldier explode on death, I've tried to make this work with respawned soldiers to, but is is wath happend:

dude1 dies, explodes as he shoud.
X sec later he respawn. but instead dude1s corpse explodes time after time. (with 15 sec delay ~15)

Now. how to make the new dude1 explode instead?

 The script (made orgilany by Armstrong):
________________________

_bomber = _this select 0
_target = _this select 1
_distance = _this select 2
_remove = _this select 3
_combatmode = _this select 4

#start

_bomber setcombatmode "_combatmode"
_bomber setspeedmode "full"
_bomber setunitpos "UP"

~0.001

? (hoppaiplasket == _remove) : removeallweapons _bomber

#over

_bomber commandmove getpos _target

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"


~0.1

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"

~0.1

? (_bomber distance _target) < _distance : goto "booom"
? !(alive _bomber) : goto "booom"

~0.1

goto "over"

#booom

bomb="heat120" camcreate getpos _bomber
bomb="shell120" camcreate getpos _bomber

~15

goto "start"
exit
___________

its looping because you havent exited the script when the _bomber is dead
I have highlighted the loop in blue

and corrected a line in red

equals to, is represented by ==, not =


what you need to do is createunit a new bomber when the unit dies and attach your script to the new unit

best way to do that is add a killed event handler to the unit and use that to create a new bomber
« Last Edit: 14 Mar 2005, 21:40:46 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

oWn

  • Guest
Re:Respawn names?
« Reply #2 on: 15 Mar 2005, 08:04:25 »
Thanks!
I have removed the loop totaly. One little thing remains:

what you need to do is createunit a new bomber when the unit dies and attach your script to the new unit

best way to do that is add a killed event handler to the unit and use that to create a new bomber

erhm.. How to do this? you have a link or somthing? ???

Ones again Thanks for your help!  :D

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Respawn names?
« Reply #3 on: 15 Mar 2005, 17:20:36 »
read the comref. it explains how to use the createunit command line
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123