Arma 3 Scripting

Command in Groups

createGroup

Also available as Markdown and JSON, or read the original wiki page.

Description

Creates a new Group for the given Side. Using this command if the group limit is reached will return grpNull. The new Group exists globally, but it's locality is where this command was executed.

Game Operation Flashpoint v1.00 Operation Flashpoint: Elite v1.00 Armed Assault v1.00 Arma 2 v1.00 Arma 2: Operation Arrowhead v1.50 Take On Helicopters v1.00 Arma 3 v1.00 Arma 3 v1.68
Group auto-deletion ✗ ✓
Group limit per side 63 144 288

Important

Note

Arma 3: - createCenter usage is not needed anymore as all centers are automatically created.

  • When the last unit leaves its group, the group usually gets immediately auto-deleted, regardless of its auto-deletion setting.

Syntax

Syntax 1

createGroup side

Parameters:

Returns: Group - grpNull if the group limit is reached

Syntax 2

since arma3 1.68

createGroup [side, deleteWhenEmpty]

Parameters:

Returns: Group - grpNull if the group limit is reached

Examples

Example 1

private _group = createGroup east;

Example 2

private _group = createGroup [east, true];

See also

deleteGroup · deleteGroupWhenEmpty · isGroupDeletedWhenEmpty · group · setGroupId · groupID · units · groupFromNetId · netId · leader · selectLeader · join · createCenter · createUnit · createVehicle · Side

Community notes

.kju

A group created with createGroup will get a waypoint at [0,0,0]. When you use createUnit to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as currentWaypoint. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints.

DreadedEntity

New group is local to the machine that executed the command (A3 2.08.149102):

player addAction ["Group Test (Dedicated Server)", {
    [[], {
        _test = createGroup [west, true];
        [str (local _test)] remoteExec ["hint", -2]; //tell all clients group locality; true
        missionNamespace setVariable ["Group_Reference", _test, true]; //broadcast group reference to all players
    }] remoteExec ["call", 2]; //create group on dedicated server only
    sleep 1;
    _newGroup = missionNamespace getVariable "Group_Reference"; //receive group reference from server
    systemChat format ["Group local to player: %1", local _newGroup]; //false
}];