OFPEC Forum

Addons & Mods Depot => Arma2 - Configs & Scripting => Topic started by: scud on 06 Oct 2009, 04:02:11

Title: detach problem
Post by: scud on 06 Oct 2009, 04:02:11
I have attached a number of turrets to a vehicle - all is good.
The trouble for me is -
when the vehicle damage> 0.8 then I would like the gunners from the attached turrets to eject.
They do not seem to fall under 'crew' even though I contrl them as such.
Title: Re: detach problem
Post by: robs on 06 Oct 2009, 09:46:46
Sorry ignore this, wrong thread.
Title: Re: detach problem
Post by: tcp on 06 Oct 2009, 18:43:58
assignedGunner doesn't work when there is more than one gunner.
If you search the forums, you'll see that Cipher by Wiper implemented a fix for disembarking multiple gunners.
Title: Re: detach problem
Post by: scud on 09 Oct 2009, 08:06:00
Ok I got it worked out - was trying to make it all too complicated I think...
here is way ended up getting it to work for anyone interested.
Code: [Select]
_boat = _this select 0;
#damBoat
~5
?(damage _boat)<=0.9 : goto "damBoat"
_allonboard =  units(group _boat)
{unassignVehicle _x} forEach _allonboard
_count = 0
#eject
(_allonboard select _count) action ["EJECT",_boat]
_count = _count + 1
~0.2
? _count != count _allonboard : goto "eject"
~10
_boat setFuel 0
Exit
my main stumbling point was this line
_allonboard =  units(group _boat) I was using group instead of units

So not really a detach problem after all.