OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: 2234jones on 25 Dec 2012, 08:31:47

Title: IED Ambush - Sqaud won't disembark their vehicles
Post by: 2234jones on 25 Dec 2012, 08:31:47
I'm trying to make an IED ambush mission but my only issue with it (so far) is the when the IED detonates, the squad and drivers of the vehicles (that have survived) don't dismount their respective vehicles. Below is my IED.sqf script:

Code: [Select]
// Spawns IED Explosion
_bomb = "Bo_GBU12_lgb" createVehicle (getPos IED);


// Tells drivers of the vehicles to stop and get out
car1 forceSpeed 0;
? (speed car1) < 1 : car1_d action ["getOut", car1];

car2 forceSpeed 0;
? (speed car2) < 1 : car2_d action ["getOut", car2]; {_x action ["getOut", car2];} forEach units wgrp1;

car1_d is the driver of the first vehicle. He was not added as a separate unit and placed in the drivers seat.

Any help would be greatly appreciated,
2234jones
Title: Re: IED Ambush - Sqaud won't disembark their vehicles
Post by: bardosy on 26 Dec 2012, 22:14:04
Try this:

Code: [Select]
{unassignVehicle _x;} forEach (units wgrp1) + [car1_d];
[car1_d]+(units wgrp1) allowgetin false;

Title: Re: IED Ambush - Sqaud won't disembark their vehicles
Post by: F2kSel on 27 Dec 2012, 13:37:20
bardosy is on the right track but if your trying to access the driver of car1 and car2 I think it's

car1d and car2d not car1_d and car2_d

you can also use driver car1

Code: [Select]
{unassignVehicle _x;} forEach (units wgrp1) + [car1d]+[driver car2];  [car1d]+[car2d]+(units wgrp1) allowgetin false;

or just eject all crew including cargo
Code: [Select]
{unassignVehicle (_x select 0); _x allowgetin false} forEach [crew vehicle car1]+ [crew vehicle car2];
Title: Re: IED Ambush - Sqaud won't disembark their vehicles
Post by: 2234jones on 27 Dec 2012, 17:57:59
Thank you F2kSel and bardosy. When the IED went off both vehicles stopped and all the surviving units got out. I've also adjusted the script to have it so the driving group joins with the players group but the driving group exits their vehicles and just stand there not falling into formation (this happens right when the IED goes off).

I used the joinSilent command for the merging of the two groups.

Code: [Select]
// Merges two groups into one

[car1d, car2d] joinSilent wgrp1;

Thanks for the help,
2234jones
Title: Re: IED Ambush - Sqaud won't disembark their vehicles
Post by: johnnyboy on 25 Jan 2013, 20:57:57
Hi Jones.  Please post your final solution, so we know which of the suggestions (or combo thereof) worked for you.   Thanks.