getUnitLoadout: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Assaultboy (talk | contribs) No edit summary |
||
Line 79: | Line 79: | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]] | [[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]] | ||
<!-- CONTINUE Notes --> | |||
<dl class="command_description"> | |||
<dd class="notedate">Posted on November 4, 2020 - 03:25 (UTC)</dd> | |||
<dt class="note">[[User:Assaultboy|Assaultboy]]</dt> | |||
<dd class="note"> | |||
Returns information in this format | |||
<code> | |||
[ | |||
[ | |||
Primary Weapon Class, | |||
Muzzle Device, | |||
Side Accessory, | |||
Optic, | |||
[ | |||
Primary Muzzle Magazine, | |||
Number of Rounds | |||
], | |||
[ | |||
Secondary Muzzle Magazine, | |||
Number of Rounds | |||
], | |||
Bipod | |||
], | |||
Launcher Weapon (Same as above), | |||
Pistol Weapon (Same as above), | |||
[ | |||
Uniform Class, | |||
[ | |||
[ | |||
Item Class, | |||
Count, | |||
Number of rounds (Only if magazine) | |||
]... | |||
] | |||
], | |||
Vest Inventory (Same as above), | |||
Backpack Inventory(Same as above), | |||
Headgear, | |||
Goggles, | |||
Binocular Weapon(Same as above), | |||
[ | |||
Map, | |||
GPS, | |||
Radio, | |||
Compass, | |||
Watch, | |||
NVG | |||
] | |||
] | |||
</code> | |||
</dd> | |||
</dl> | |||
<!-- DISCONTINUE Notes --> |
Revision as of 04:25, 4 November 2020
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" }; };
- Groups:
- Unit Inventory
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
Notes
Bottom Section
- Posted on November 4, 2020 - 03:25 (UTC)
- Assaultboy
-
Returns information in this format
[ [ Primary Weapon Class, Muzzle Device, Side Accessory, Optic, [ Primary Muzzle Magazine, Number of Rounds ], [ Secondary Muzzle Magazine, Number of Rounds ], Bipod ], Launcher Weapon (Same as above), Pistol Weapon (Same as above), [ Uniform Class, [ [ Item Class, Count, Number of rounds (Only if magazine) ]... ] ], Vest Inventory (Same as above), Backpack Inventory(Same as above), Headgear, Goggles, Binocular Weapon(Same as above), [ Map, GPS, Radio, Compass, Watch, NVG ] ]