Jump to content

Recommended Posts

Hi all,

This is probably so simple to do so apologies for that.

How do I delete a group of infantry?

I have created a group of infantry in the editor and named the squad leader "Badger". Now I have tried deleteGroup Badger in a trigger but it doesn't work. I have also tried deleteVehicle and some other stuff off the forums. Any help please?

Share this post


Link to post
Share on other sites

Maybe somehow like:

{ deleteVehicle _x }forEach units (group Badger);

But this would probably suck if Badger was dead(?), so add to his init-field:

GrpBadger = group this;

And then in your deletion trigger:

{ deleteVehicle _x }forEach units GrpBadger;

Edit: Ah, austin was quick, and maybe it works as simple as he says, I seem to do everything a bit complicated way :P

Share this post


Link to post
Share on other sites

I am so sure I tried that earlier, must have been syntax error on my part, thx mate.

Cheers guys,

The actual group don't really do anything in the mission, they go from 1 area then when they are out of sight they get deleted. Trying to save on the amount of AI on the field all at once as it were.

Share this post


Link to post
Share on other sites

I thought that the group name would automatically be named the group leaders name? meh whatever, will probably still work ^^ if it doesn't let us know

Share this post


Link to post
Share on other sites

Working lovely!

Quick one, if I only wanted to delete a certain side, ie Bluefor or Opfor how would I do that?

Share this post


Link to post
Share on other sites

You want to delete all of one side?

{if (side _x == opfor) then {deleteVehicle _x}} forEach allUnits;

Share this post


Link to post
Share on other sites

{if (side _x == opfor) then {deleteVehicle _x}} forEach allUnits;

And also after that, use:

{if (side _x == opfor) then {deleteGroup _x}} forEach allGroups;

In order to clean up leftover empty groups.

Share this post


Link to post
Share on other sites

{deleteVehicle _x} foreach (crew Your_VarName); deleteVehicle Your_VarName;

Share this post


Link to post
Share on other sites
13 hours ago, major-stiffy said:

{deleteVehicle _x} foreach (crew Your_VarName); deleteVehicle Your_VarName;

Yep, like the old fashion (before Arma 2.06).

 

If the vehicle has no variableName but you have an identified (e.g.) group of soldiers inside, and you wanna delete the vehicle and its crewmen, they must be deleted in this way:

// Context: 
// - You got a soldiers group called (variable name) "_grpOfSoldiers".
// - The _grpOfSoldiers is inside a vehicle (without variablename itself).

// First, delete the vehicle of _grpOfSoldiers leader:
deleteVehicle (vehicle leader _grpOfSoldiers);

// Last, delete the vehicle crew (not including players if there's some in _grpOfSoldiers):
{ deleteVehicle _x } forEach (units _grpOfSoldiers);

// P.S.: the order of the line above is crucial for the delete command to work. If you delete
// the named group first and, after that, you'd try to delete the "vehicle _grpOfSoldiers", 
// as the _grpOfSoldiers wouldn't exist anymore, it would print out an error. 

 

If the vehicle has variableName but the crewmen have not:

// Context: 
// - You got a vehicle called (variable name) "_myVeh1".
// - Inside _myVeh1 vehicle there is a group of soldiers (crew, without variablename itself).

// First, delete the vehicle crewmen (not including players if there's some in the vehicle):
deleteVehicleCrew _myVeh1;

// Last, delete the vehicle itself:
deleteVehicle _myVeh1;

// P.S.: the order of the line above is crucial for the delete command to work. If you delete
// the named vehicle (_myVeh1) first and, after that, you'd try to delete the unnamed crewmen,
// as the vehicle _myVeh1 wouldn't exist anymore, it would print out an error.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×