OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Crassus on 02 Feb 2004, 05:45:25
-
The following is the code to get one stick of jumpers out of an An-124. They exit fine, but when they hit the drop zone they chase after their assigned aircraft.
As you can see, I attempted to "lock" the bird, though this didn't work; the paratroopers still chase their plane. (I also tried destroying the bird after it had flown out of the area of the DZ, to no avail.)
I'm hoping someone knows how I can get them to stop chasing the bird, sometimes right into the ocean. ::)
"unassignVehicle _x" forEach stick1
_jumpers = stick1
_a = 0
_b = count _jumpers
#Go
(_jumpers select _a) action ["EJECT", condor]
unassignVehicle (_jumpers select _a)
_a = _a + 1
~.1
? _b > _a: goto "Go"
condor lock true
-
"unassignVehicle _x" forEach stick1 <-- MOVE THIS LINE
_jumpers = units stick1 <-- CHANGE THIS
_a = 0
_b = count _jumpers
#Go
(_jumpers select _a) action ["EJECT", condor]
unassignVehicle (_jumpers select _a)
_a = _a + 1
~.1
? _b > _a: goto "Go"
"unassignVehicle _x" forEach _jumpers <-- DOWN TO HERE
condor lock true <-- DELETE THIS LINE
exit <--ADD THIS (IF YOUR SCRIPT IS FINISHED)
By unassigning them before they eject, you're basically giving them a GET OUT waypoint, probably at the airfield, ::) since they're in a plane. Even tho you eject them, they still want to complete their get out order. Unassign them individually as you already do, then at the end just for insurance you can do the group.
-
_jumpers = units stick1 <-- CHANGE THIS
I don't think I would change this as you recommend, would I. stick1 is an array (?) of six (6) groups.
stick1 = []
...
stick1 = units squad1 + units squad1A + units squad1B + units squad2 + units squad2A + units squad3A
...
"_x moveInCargo condor" forEach stick1
-
Yeah, just tested it.
_jumpers = units stick1
The script wants an array; using _jumpers = units stick1 causes an error.
But putting "unassignVehicle _x" forEach _jumpers after the eject loop did the trick; they're not chasing the A/C.
Thanks very much. 8)