Jump to content
Sign in to follow this  
tophe

How come this script only works for some units?

Recommended Posts

I dug out this old excellent vehicle respawn script by DoLittle.

I know there are a few smaller scripts that works fine but I really like this one.

Since it also respawns abandoned vehichles that has not been destroyed.

However... It works fine but only for some types.

It won't respawn AH-1Z choppers or AH-6 choppers.

All other vehicles (that I have tried) will work fine, including all air vehicles...

I've looked through it and I can't figure out why. Those choppers respawn fine wither other scripts, using the same type of functions.

I've tried having only them on the map also.

Can anyone understand why those two chopper won't respawn with this script?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;By Doolittle

;USE

;put into INIT FIELD of 1st vehicle on map: vehicles = [this]

;put into INIT FIELDS of any other vehicle: vehicles = vehicles + [this]

;make trigger that runs ONCE: Condition: local Server OnActivation: [] exec "vehicles.sqs"

;make a GameLogic called Server

?! (local server):exit

_vpos = []

_vdir = []

_vtime = []

_count = count vehicles

_delay = 1

_delaya = 120

_i = 0

#load

_v = vehicles select _i

_vpos = _vpos + [[getPos _v select 0, getPos _v select 1, 0]]

_vdir = _vdir + [getDir _v]

_vtime = _vtime + [0]

_i = _i + 1

?_i < _count : goto "load"

#init

_i = 0

~20

#alive

_v = vehicles select _i

?fuel _v == 1 : goto "continue"

?alive _v and count crew _v != 0 : _vtime set [_i, 0]

_vt = _vtime select _i

?_vt != 0 and _vt < _time : goto "notalive"

?count crew _v == 0 and _vt == 0 : _vtime set [_i, _time + _delaya]

?!alive _v and _vt == 0 : _vtime set [_i, _time + _delay]

#continue

_i = _i + 1

?_i < _count : goto "alive"

goto "init"

#notalive

_vtype = typeOf _v

deleteVehicle _v

~1

_v = _vtype createVehicle (_vpos select _i)

_v setDir (_vdir select _i)

vehicles set [_i, _v]

_vtime set [_i, 0]

goto "continue"

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×