OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: OrnelP on 16 Nov 2005, 04:28:22
-
??? I read the comref and have 3 versions of them but none seem to help me. i have an airplane carrying a standard BIS soldier group and want them to EJECT from plane to simulate a Paradrop, i do not know how to script but i have improvised using Init fields.
Syntax.
{_x action ["eject", plane]} foreach units group sanders
now this works they eject, but as soon as they land, the leader begins telling everyone to get back into the plane. so i put this, but does not work.
Unassign Sanders, then sanders is the only one to be unassigned. But i know there is a way to make the whole group named g1 but i have failed to make it succesful.
Group1 = Group this ? no idea how please help
-
Also i do not want to use an existing script or mission, i know they exist but they are to difficult for my noobizm.
-
This should do it:
{unassignvehicle _x} foreach units group sanders
-Pilot
-
i will have to see if that works, but i dont understand how it will, by the way, what does the _X mean? and would it work for multiple airplanes?
eg {unassignvehicle _x} foreach units group sanders
{unassignvehicle _x} foreach units group randall
? is it the current airplane they are in?
what about the group question how do i organize a group
foreach units sanders group this?
-
In the init field of the group leader write
sanders = group this
Regarding _x, somebody will doubtless be along soon to to write an accurate but largely incomprehensible essay on the scope of variables. The point is that "_x ... forEach ..." means 'carry out the same command on each unit'. In other words, _x stands for each unit in turn.
The aircraft doesn't come in to it directly - the command will eject the loons from whatever vehicle they happen to be in.
When the loons eject, they are still assigned to the vehicle. That's why you need the unAssign command as well as the eject command.