getUnitLoadout: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (template:command argument fix)
Line 14: Line 14:
};</syntaxhighlight>
};</syntaxhighlight>


|= Description
|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[getUnitLoadout]] unit |= Syntax
| [[getUnitLoadout]] unit |SYNTAX=
|p1= unit: [[Object]] |= Parameter 1
|p1= unit: [[Object]] |PARAMETER1=


| [[Array]] - [[Unit Loadout Array]] |= Return Value
| [[Array]] - [[Unit Loadout Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|s2= [[getUnitLoadout]] [unit, fullMagazines] |= Syntax
|s2= [[getUnitLoadout]] [unit, fullMagazines] |SYNTAX=
|p21 = [unit, fullMagazines]: [[Array]] |= Parameter 1
|p21 = [unit, fullMagazines]: [[Array]] |PARAMETER1=
|p22= unit: [[Object]] |= Parameter 2
|p22= unit: [[Object]] |PARAMETER2=
|p23= fullMagazines: [[Boolean]] - [[true]] to top up used magazines|= Parameter 3
|p23= fullMagazines: [[Boolean]] - [[true]] to top up used magazines|PARAMETER3=


|r2= [[Array]] - [[Unit Loadout Array]] |= Return value
|r2= [[Array]] - [[Unit Loadout Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|s3= [[getUnitLoadout]] name |= Syntax
|s3= [[getUnitLoadout]] name |SYNTAX=
|p41= name: [[String]] - class name (see description)|= Parameter 1
|p41= name: [[String]] - class name (see description)|PARAMETER1=


|r3= [[Array]] - [[Unit Loadout Array]] |= Return value
|r3= [[Array]] - [[Unit Loadout Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|s4= [[getUnitLoadout]] config |= Syntax
|s4= [[getUnitLoadout]] config |SYNTAX=
|p61= config: [[Config]] - config class (see description) |= Parameter 1
|p61= config: [[Config]] - config class (see description) |PARAMETER1=


|r4= [[Array]] - [[Unit Loadout Array]] |= Return value
|r4= [[Array]] - [[Unit Loadout Array]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1= <code>[[getUnitLoadout]] [[player]];</code>|=
|x1= <code>[[getUnitLoadout]] [[player]];</code>|=

Revision as of 15:40, 7 April 2019

Hover & click on the images for description

Description

Description:
Returns a Unit Loadout Array with all assigned items, weapons, containers and their stored items. When String for class name is supplied, the command will search CfgVehicles for the given class in order to extract the loadout from config. If Config is given, it will search given config (including mission config) for the loadout information. In either case, the config should contain the following entries, which is standard for any unit class, for example:
class MyLoadout
{
	uniformClass = "U_B_CombatUniform_mcam";
	backpack = "B_AssaultPack_mcamo";
	linkedItems[] = {"V_PlateCarrier1_rgr","H_HelmetB","ItemCompass","ItemWatch","ItemRadio","NVGoggles"};
	weapons[] = {"arifle_MX_ACO_pointer_F","hgun_P07_F"};
	items[] = {"FirstAidKit","FirstAidKit","FirstAidKit"};
	magazines[] = {"30Rnd_65x39_caseless_mag","16Rnd_9x21_Mag","SmokeShell","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade"};
};
Groups:
Uncategorised

Syntax 1

Syntax:
getUnitLoadout unit
Parameters:
unit: Object
Return Value:
Array - Unit Loadout Array

Syntax 2

Syntax:
getUnitLoadout [unit, fullMagazines]
Parameters:
[unit, fullMagazines]: Array
unit: Object
fullMagazines: Boolean - true to top up used magazines
Return Value:
Array - Unit Loadout Array

Syntax 3

Syntax:
getUnitLoadout name
Parameters:
name: String - class name (see description)
Return Value:
Array - Unit Loadout Array

Syntax 4

Syntax:
getUnitLoadout config
Parameters:
config: Config - config class (see description)
Return Value:
Array - Unit Loadout Array

Examples

Example 1:
getUnitLoadout player;
Example 2:
getUnitLoadout [player, true];
Example 3:
getUnitLoadout "B_Soldier_F";
Example 4:
getUnitLoadout (configFile >> "CfgVehicles" >> "B_Soldier_F");
Example 5:
getUnitLoadout (missionConfigFile >> "MyLoadout");

Additional Information

See also:
setUnitLoadout

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

Notes

Bottom Section