BIS fnc spawnGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (template:command argument fix)
Line 8: Line 8:
|version2= 1.00 |=
|version2= 1.00 |=


|arg= |= MPARGUMENTS
|arg= |MPARGUMENTS=  


|eff= |= MPEFFECTS
|eff= |MPEFFECTS=  
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 43: Line 43:


|x1= Spawn five random EAST units at aPos:
|x1= Spawn five random EAST units at aPos:
<code>[ [[getPos]] aPos, EAST, 5] [[call]] [[BIS_fnc_spawnGroup]]</code>|= EXAMPLE1
<code>[ [[getPos]] aPos, EAST, 5] [[call]] [[BIS_fnc_spawnGroup]]</code>|EXAMPLE1=  


|x2= Spawn a Stryker MGS Platoon at marker "tankSpawn":
|x2= Spawn a Stryker MGS Platoon at marker "tankSpawn":
<code>[ [[getMarkerPos]] "tankSpawn", [[side]] [[player]], ([[configFile]] >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] [[call]] [[BIS_fnc_spawnGroup]]</code>|= EXAMPLE2
<code>[ [[getMarkerPos]] "tankSpawn", [[side]] [[player]], ([[configFile]] >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] [[call]] [[BIS_fnc_spawnGroup]]</code>|EXAMPLE2=  


|x3= Spawn a TK Militia Medic and Soldier at aPos facing south:
|x3= Spawn a TK Militia Medic and Soldier at aPos facing south:
<code>[ [[getPos]] aPos, [[EAST]], ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] [[call]] [[BIS_fnc_spawnGroup]]</code>|= EXAMPLE3
<code>[ [[getPos]] aPos, [[EAST]], ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] [[call]] [[BIS_fnc_spawnGroup]]</code>|EXAMPLE3=  
__________
__________


| [[ArmA_2:_CfgVehicles | Arma 2 CfgVehicles]] |= SEEALSO
| [[ArmA_2:_CfgVehicles | Arma 2 CfgVehicles]] |SEEALSO=  


|  |= MPBEHAVIOUR
|  |MPBEHAVIOUR=  
____________________________________________________________________________________________
____________________________________________________________________________________________
}}
}}

Revision as of 11:29, 7 April 2019

Hover & click on the images for description

Description

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. 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.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[position, side, character details, relative positions, list of ranks, skill range, ammo count range, randomization controls, azimuth] call BIS_fnc_spawnGroup
Parameters:
position - group's starting position (Array)
side - group's Side (Side)
character details - Can be three different types: a list of character types (Array), an amount of characters to spawn (Number) or a CfgGroups entry (Config)
(optional) a list of relative positions (Array)
(optional) a list of ranks (Array)
(optional) skill range (Array)
(optional) ammunition count range (Array)
(optional) randomization controls (Array) 0: amount of mandatory units (Number) 1: spawn chance for remaining units (Number)
(optional) azimuth/Direction (Number)
Return Value:
(Group)

Examples

Example 1:
Spawn five random EAST units at aPos: [ getPos aPos, 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

Additional Information

See also:
Arma 2 CfgVehicles

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note


Bottom Section

Posted on August 23, 2016 - 02:42 (UTC)
Snake Plissken
Factions are represented by the letters

WEST = BLUFOR
EAST = OPFOR
GUER = INDEPENDENT
CIV = CIVIL.

To spawn one BLUFOR group, the command be
"MARK1" is the name given to the marking placed on the map, where the group will appear. 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;
But to spawn an independent group, is not using "GUER" but the name "INDEPENDENT" 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;
I can not say that the correct would be to put the name "GUER" as in other factions, or is this an error for a correction future.
Posted on August 2, 2017 - 19:06 (UTC)
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.
Posted on October 15, 2018 - 21:59 (UTC)
Pierre MGI
There are two parameters more:
_this select 9: (optional) force precise position (Bool, default: true). // important: for spawning vehicles without collision, set it to false
_this select 10: (optional) max. number of vehicles (Number, default: 10e10).