OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: zwobot on 23 Nov 2009, 00:12:33

Title: Dismount script [solved]
Post by: zwobot on 23 Nov 2009, 00:12:33
Hello,
I want to make a mechanised infantry squad dismount their transport (in the same group) at a SCRIPTED waypoint. Therefor I have the following script:
Code: [Select]
private["_group", "_i", "_vehicle"];

_group = _this select 0;

_units = units _group;
_vehicle = vehicle leader _group;

_group setFormation "VEE";
_group setSpeedMode "LIMITED";

{
if( (_x != gunner _vehicle) && (_x != driver _vehicle) && (_x != commander _vehicle)) then {
_x action["eject", _vehicle];
unassignVehicle _x;
[_x] allowGetIn false;
};
} foreach _units;

So basically everyone who is not crew in the vehicle should dismount but the script does not work and I have no idea why. I have ported the script from Ofp where it works perfectly.
Can you help me please?
Title: Re: Dismount script
Post by: alimag on 26 Nov 2009, 19:58:12
Hi,

Theorically, it should work if called correctly.

In Arma 2 this should be an SQF script and should be called with the execVM command.

Is this the way the scripted waypoint is calling it?

Cheers
Title: Re: Dismount script
Post by: zwobot on 28 Nov 2009, 14:26:56
Thanks for the response alimag. I found out that Arma2 only executes sqs with SCIPTED waypoints. When you enter a sqf script in the "Script" line of the waypoint control structures (for- loops, if selections etc.) aren't executed properly.
Title: Re: Dismount script [solved]
Post by: Rommel92 on 05 Dec 2009, 09:00:33
You could try the execvm in the script your executing... if it means that much to you.