Hey, searched for this but came up with some unanswered topics.
I am using an artillery script and I want it to be cancelled if a particular unit is destroyed.
Basically what I have is the artillery script dropping single shells around the target, but not guaranteed to hit. If the first shell destroys it, I would like the script to stop there rather than dropping the remaining shells.
I found another thread with a kind of similar problem where someone suggested adding the following lines to a script:
if (!alive radar) then goto "end"
#end
exit
I tried this but I'm not sure where to add the lines. The commands are either ignored completely or end up cancelling the script before it even begins.
Here is the main body of the script I am using:
_counter=0
~5
#beg
~_delay
_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2
_cx = _cx + random _spread
_cy = _cy + random _spread2
;this bit lifts the bomb to a high altitude so you can see it falling
_cz = _cz + 200
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.01
_tempObj = objNull
_counter = _counter + 1
?(_counter == _Shells):exit
goto "beg"
Any suggestions appreciated!