Home   Help Search Login Register  

Author Topic: IED Ambush - Sqaud won't disembark their vehicles  (Read 3209 times)

0 Members and 1 Guest are viewing this topic.

Offline 2234jones

  • Members
  • *
IED Ambush - Sqaud won't disembark their vehicles
« 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

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: IED Ambush - Sqaud won't disembark their vehicles
« Reply #1 on: 26 Dec 2012, 22:14:04 »
Try this:

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

Fix bayonet!

Offline F2kSel

  • Members
  • *
Re: IED Ambush - Sqaud won't disembark their vehicles
« Reply #2 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];
« Last Edit: 27 Dec 2012, 13:46:24 by F2kSel »

Offline 2234jones

  • Members
  • *
Re: IED Ambush - Sqaud won't disembark their vehicles
« Reply #3 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

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: IED Ambush - Sqaud won't disembark their vehicles
« Reply #4 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.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...