OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods Beta Testing => Topic started by: JackDVS on 25 Jan 2005, 02:10:59
-
How do you script a squad to eject from a moving vehicle, with or without having the driver/pilot make a waypoint for it.
-
Wrong board, BTW...
WITHOUT A WAYPOINT:
If you want a delay between soldiers coming out of the vehicle, use this:
_i = 0
_k = count units NameOfYourGroup
#Loop
_j = units NameOfYourGroup select _i
_j action [{EJECT}, NameOfYourVehicle]
unassignvehicle _j
~1
_i = _i + 1
? (_i == _k) : exit
goto "Loop"Adjust the '~1' to whatever delay you want in seconds.
If you don't need a delay, you can use this:
"_x action [{EJECT}, NameOfYourVehicle]" forEach units NameOfYourGroup
"unassignvehicle _x" forEach units NameOfYourGroupSyntax not tested, but it should be OK.
Give your group a name first with a command in group member's init field:
gw = group thisAnd use that name in the scripts.
Or you can customize these scripts to suit your needs, for example making them a more generic form scripts that take arguments.
You got the idea.