I'm using David Berka's Cargo Helidrop script in a mission. I want to add in a trigger where the heli would drop its cargo before its intended drop zone if it becomes heavily damaged, so that the cargo can still be saved.
;Here's the script:
; script by David Berka (David.Berka@nmi.at)
_heli = _this select 0
_car = _this select 1
_chute = _this select 2
#Update
_heliPos = getPos _heli
_heliPosX = _heliPos select 0
_heliPosY = _heliPos select 1
_heliPosZ = _heliPos select 2
_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2
_chute setPos [_chutePosX, _chutePosY, 300]
_car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]
_heading = getDir _heli
_car setDir _heading
~0.01
?(release1 == 1) : goto "Drop"goto "Update"
#Drop
_chute setDir _heading
~0.01
_carPos = getPos _car
_carPosX = _carPos select 0
_carPosY = _carPos select 1
_carPosZ = _carPos select 2
_chute setPos [_carPosX, _carPosY, _heliPosZ - 18]
#DropUpdate
_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2
_car setPos [_chutePosX, _chutePosY, _chutePosZ - 3]
~0.01
? (_chutePosZ > 3) : goto "DropUpdate"
;(By the way, I altered this line (from 3 to 5) to give more
;clearance to vehicles under heli ):
_car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]
============================================
The line
release1 == 1 is placed
in a vehicle-switched trigger for the normal drop area. So how would I incorporate a
getdammage-type script checking for >=30% damage to heli and have it drop its cargo right there? Would it just be a separate trigger or does it need to be in same or different script?
Thanks!