BIS fnc spawnGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
(Description of BIS Function: BIS_fnc_spawnGroup)
Line 1: Line 1:
{{Command|=
____________________________________________________________________________________________
| arma2 |=
|1.00|=
|arg= |= MPARGUMENTS


{{Function|= Comments
|eff= |= MPEFFECTS
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| 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.


|1.00|= Game version
|=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| [position, side, character details] call '''BIS_fnc_spawnGroup'''  |=
/*
 
File: spawnGroup.sqf
|p1= position - group's starting [[position]] ([[Array]]) |=
 
|p2= side - group's [[Side]] ([[Side]]) |=
 
|p3= 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]]) |=
 
|([[Group]])  |= Return value
 
|s2= [position, side, character details, ''relative positions, list of ranks, skill range, ammo count range, randomization controls, azimuth''] call '''BIS_fnc_spawnGroup'''  |=
 
|p21= (optional) a list of relative positions ([[Array]]) |=
 
|p22= (optional) a list of ranks ([[Array]]) |=
 
|p23= (optional) skill range ([[Array]]) |=


Description:
|p24= (optional) ammunition count range ([[Array]]) |=
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.


Parameter(s):
|p25= (optional) randomization controls ([[Array]]) 0: amount of mandatory units ([[Number]]) 1: spawn chance for remaining units ([[Number]]) |=
_this select 0: the group's starting position (Array)
_this select 1: the group's side (Side)
_this select 2: can be three different types:
- list of character types (Array)
- amount of characters (Number)
- CfgGroups entry (Config)
_this select 3: (optional) list of relative positions (Array)
_this select 4: (optional) list of ranks (Array)
_this select 5: (optional) skill range (Array)
_this select 6: (optional) ammunition count range (Array)
_this select 7: (optional) randomization controls (Array)
0: amount of mandatory units (Number)
1: spawn chance for the remaining units (Number)
_this select 8: (optional) azimuth (Number)
_this select 9: (optional) force precise position (Bool, default: true).
_this select 10: (optional) max. number of vehicles (Number, default: 10e10).


Returns:
|p26= (optional) azimuth/[[Direction]] ([[Number]]) |=
The group (Group)
*/


//Validate parameter count
|r2= ([[Group]]) |= Return value
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


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


|p1= |= Parameter 1
|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


| |= Return value
|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


|x1= <code></code> |=
__________
____________________________________________________________________________________________


| |= See also
| [[Functions Library]], [[ArmA_2:_CfgVehicles | Arma 2 CfgVehicles]] |= SEEALSO


|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
<h3 style='display:none'>Bottom Section</h3>
</dl>


<h3 style="display:none">Bottom Section</h3>
[[Category:ArmA 2: Functions|BIS_FNC_SPAWNGROUP}}]]
[[Category:Function Group: Spawning|{{uc:spawnGroup}}]]
[[Category:Functions|{{uc:spawnGroup}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:spawnGroup}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:spawnGroup}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:spawnGroup}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:spawnGroup}}]]

Revision as of 03:42, 19 September 2010

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

Syntax

Syntax:
[position, side, character details] 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)
Return Value:
(Group)

Alternative Syntax

Syntax:
[position, side, character details, relative positions, list of ranks, skill range, ammo count range, randomization controls, azimuth] call BIS_fnc_spawnGroup
Parameters:
(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:
Functions Library 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