Hello,
I've wrote a script to make divers vulnerable while they're diving, but there's a problem with it.
I simply create a FOX invisible target on top of the diver's vehicle (from his ITMS-script) while it's underwater and known by his enemies.
The diver can be shot, but it rarely happen, it's just a scary effect.
Thing is... when I show myself to the enemy, dive into the water, the script won't work.
But when i step out of the water again and make a second dive the script works fine.
_diver = _this select 0
_enemy = _this select 1
?side _diver == WEST : _side = "W_"
?side _diver == EAST :_side = "E_"
?side _diver == RESISTANCE : _side = "G_"
#loop
_diverdam = getdammage _diver
_kn = _enemy knowsabout _diver
?_kn > 0.105 && typeof vehicle _diver == "CoC_LAR7SWM": goto "spawntar"
~1
goto "loop"
#spawntar
vehicle _diver Setdammage _diverdam
_tp = "M_"
_tarname = "FOX2_"
_tarname = _tarname + format ["%1", _side]
_tarname = _tarname + format ["%1", _tp]
_tarname = _tarname + "LO"
_tarname = _tarname + "_IT"
_tgt = _tarname createVehicle _pos
#update
?typeof vehicle _diver != "CoC_LAR7SWM" or !alive _diver: goto "destroy"
_pos = [(getpos vehicle _diver select 0) - 1 + random 2,(getpos vehicle _diver select 1)- 1 + random 2, + 1.5]
_tgt setpos _pos
~1
goto "update"
#destroy
deletevehicle _tgt
?!alive _diver : deletevehicle vehicle _diver;exit
goto "loop"
Below a testmission, the script is still in an early stage.
You'll need the
COCdiver and
FOX invisible targets.