Arma 3 Scripting

BIS_fnc_spawnGroup

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Function · Markdown · JSON · original wiki page

Description

Function which handles the spawning of a dynamic group of characters. The composition of the group can be passed to the function. Alternatively, a number can be passed and the function will spawn that amount of characters with a random type.

Note

Before Arma 3 a side's Center must have been created before a group may be spawned either by using createCenter or an editor placed (0% Probability of Presence is fine) unit of the appropriate side.

Syntax

[position, side, toSpawn, relPositions, ranks, skillRange, ammoRange, randomControls, azimuth, precisePos, maxVehicles] call BIS_fnc_spawnGroup

Parameters:

Returns: Group

Examples

Example 1

Spawn five random EAST units at aPosition:

[getPosATL aPosition, east, 5] call BIS_fnc_spawnGroup;

Example 2

Spawn a Stryker MGS Platoon at marker "tankSpawn":

[getMarkerPos "tankSpawn", side player, (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] call BIS_fnc_spawnGroup;

Example 3

Spawn a TK Militia Medic and Soldier at aPos facing south:

[getPos aPos, east, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

See also

Arma 2: CfgVehicles · Arma 3: Assets

Community notes

Snake Plissken

Sides are as follow:

To spawn one BLUFOR group ("MARK1" is the name given to a map marker):

Group_Name_Here = [getMarkerPos "MARK1", WEST, ["B_G_Soldier_A_F", "B_G_Soldier_F", "B_G_Soldier_AR_F", "B_G_Soldier_LAT_F"]] call BIS_fnc_spawnGroup;

Or a random group OPFOR of seven units

Group_Name_Here = [getMarkerPos "MARK1", EAST, 7] call BIS_fnc_spawnGroup;

an independent group:

Group_Name_Here = [getMarkerPos "MARK1", INDEPENDENT, ["I_G_Soldier_A_F", "I_G_Soldier_F", "I_G_Soldier_AR_F", "I_G_Soldier_LAT_F"]] call BIS_fnc_spawnGroup;

Cheitan

When using this function for making a dynamic AI spawn, pay attention to the fact that none of the created groups will be marked for auto-deletion when the group become empty (all members dead). It means that it can be very easy to hit the 144 (288 for A3) max groups per side limitation, implying that no more AI or group can be created afterwards. To avoid this issue on Arma 3, don't forget to use deleteGroupWhenEmpty command in your script.