{"name":"Unit Loadout Array","title":"Unit Loadout Array","type":"topic","url":"https://community.bistudio.com/wiki/Unit_Loadout_Array","revid":322627,"updated":"2022-06-20T04:44:27Z","aliases":[],"markdown":"| Index | Element | Description |\n|---|---|---|\n| 0 | Primary Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 1 | Secondary Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 2 | Handgun Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 3 | Uniform | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 4 | Vest | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 5 | Backpack | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 6 | Headgear | classname (String) |\n| 7 | Goggles/Facewear | classname (String) |\n| 8 | Binoculars | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 9 | Assigned Items<br>- in a different order<br>  than assignedItems<br>- no binoculars | - Map<br>- GPS/UAV terminal<br>- Radio<br>- Compass<br>- Watch<br>- NVG |\n\nThis array format is used with getUnitLoadout and setUnitLoadout commands. Its format is described in the side table.\n\n> [!NOTE]\n> **Weapons** listed as storage items are always listed at the end of the array, but are displayed at the top of the list in the UI.\n\n### Examples\n\nThese are examples of Unit Loadout Array structures (see getUnitLoadout, setUnitLoadout).\n\n#### B_soldier_AT_F\n\n```cpp\n[\n    /* primary weapon */    [\"arifle_MXC_Holo_pointer_F\", \"\", \"acc_pointer_IR\", \"optic_Holosight\", [\"30Rnd_65x39_caseless_mag\", 30], [], \"\"],\n    /* secondary weapon */    [\"launch_B_Titan_short_F\", \"\", \"\", \"\", [\"Titan_AT\", 1], [], \"\"],\n    /* handgun weapon */    [\"hgun_P07_F\", \"\", \"\", \"\", [\"16Rnd_9x21_Mag\", 16], [], \"\"],\n    /* uniform */            [\"U_B_CombatUniform_mcam\", [[\"FirstAidKit\", 1], [\"30Rnd_65x39_caseless_mag\", 2, 30], [\"Chemlight_green\", 1, 1]]],\n    /* vest */                [\"V_PlateCarrier1_rgr\", [[\"30Rnd_65x39_caseless_mag\", 3, 30], [\"16Rnd_9x21_Mag\", 2, 16], [\"SmokeShell\", 1 ,1], [\"SmokeShellGreen\", 1, 1], [\"Chemlight_green\", 1, 1]]],\n    /* backpack */            [\"B_AssaultPack_mcamo_AT\",[[\"Titan_AT\", 2, 1]]],\n    /* items */                \"H_HelmetB_light_desert\", \"G_Bandanna_tan\",[],\n    /* items */                [\"ItemMap\", \"\", \"ItemRadio\", \"ItemCompass\", \"ItemWatch\", \"NVGoggles\"]\n]\n```\n\n#### Misc\n\n```cpp\n[\n    [\n        \"arifle_MX_GL_F\",\"muzzle_snds_H\", \"acc_pointer_IR\", \"optic_Aco\",    // Primary weapon, (weapon items) silencer, pointer, optic\n        [\"30Rnd_65x39_caseless_mag\", 30],                                    // Loaded mag in primary muzzle, ammo count\n        [\"1Rnd_HE_Grenade_shell\", 1],                                        // Loaded mag in secondary muzzle, ammo count\n        \"\"    // Bipod\n    ],\n    [],    // Secondary weapon info (see primary above)\n    [    // handGun info (see primary above)\n        \"hgun_P07_F\", \"\", \"\", \"\",\n        [\"16Rnd_9x21_Mag\", 16],\n        [],\n        \"\"\n    ],\n    [    // Uniform\n        \"U_B_CombatUniform_mcam\", // Uniform Type\n        [    // Uniform Items\n            [\"FirstAidKit\", 1],    // Type, count\n            [\"30Rnd_65x39_caseless_mag\", 2, 30] // Magazines are: Type, count, ammo\n        ]\n    ],\n    [    // Vest Info\n        \"V_PlateCarrierGL_rgr\",    // Vest Type\n        [    // Vest Items\n            [\"30Rnd_65x39_caseless_mag\", 3, 30]\n        ]\n    ],\n    [   // Backpack Info\n        \"B_Carryall_ocamo\",                    // Backpack type\n        [    // Backpack Items\n            [\"B_Carryall_khk\", true],          // A backpack inside the backpack (isBackpack is true, so item is defined in CfgVehicles)\n            [\"U_B_CombatUniform_mcam\", false], // A uniform inside the backpack (isBackpack is false, so item is defined in CfgWeapons)\n            // A weapon inside the backpack\n            [[\"arifle_MX_ACO_pointer_F\", \"\", \"acc_pointer_IR\", \"optic_Aco\", [], [], \"\"], 1]\n        ]\n    ],\n    \"H_HelmetSpecB_blk\",                    // Helmet\n    \"G_Tactical_Clear\",                        //Facewear glasses/bandanna etc\n    [\"Binocular\", \"\", \"\", \"\", [], [], \"\"],    // Weapon Binocular (follows same layout as other weapons above)\n    [\"ItemMap\", \"ItemGPS\", \"ItemRadio\", \"ItemCompass\", \"ItemWatch\", \"NVGoggles\"]    // AssignedItems ItemGPS can also be a UAV Terminal\n]\n```","sections":[{"heading":null,"level":1,"markdown":"| Index | Element | Description |\n|---|---|---|\n| 0 | Primary Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 1 | Secondary Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 2 | Handgun Weapon | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 3 | Uniform | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 4 | Vest | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 5 | Backpack | - classname<br>- Array of:<br>  - If item: items name and count<br>  - If magazine: magazines name, count, and their ammo count<br>  - If weapon: weapon detail (see the `Primary Weapon`) and count<br>  - If container (backpack/vest/uniform): container name and whether it's a backpack (backpacks are defined in `CfgVehicles`, and vests and uniforms in `CfgWeapons`) |\n| 6 | Headgear | classname (String) |\n| 7 | Goggles/Facewear | classname (String) |\n| 8 | Binoculars | - classname<br>- suppressor<br>- pointer<br>- optics<br>- muzzle 1's magazine and ammunition<br>- muzzle 2's magazine and ammunition<br>- bipod |\n| 9 | Assigned Items<br>- in a different order<br>  than assignedItems<br>- no binoculars | - Map<br>- GPS/UAV terminal<br>- Radio<br>- Compass<br>- Watch<br>- NVG |\n\nThis array format is used with getUnitLoadout and setUnitLoadout commands. Its format is described in the side table.\n\n> [!NOTE]\n> **Weapons** listed as storage items are always listed at the end of the array, but are displayed at the top of the list in the UI."},{"heading":"Examples","level":3,"markdown":"These are examples of Unit Loadout Array structures (see getUnitLoadout, setUnitLoadout)."},{"heading":"B_soldier_AT_F","level":4,"markdown":"```cpp\n[\n    /* primary weapon */    [\"arifle_MXC_Holo_pointer_F\", \"\", \"acc_pointer_IR\", \"optic_Holosight\", [\"30Rnd_65x39_caseless_mag\", 30], [], \"\"],\n    /* secondary weapon */    [\"launch_B_Titan_short_F\", \"\", \"\", \"\", [\"Titan_AT\", 1], [], \"\"],\n    /* handgun weapon */    [\"hgun_P07_F\", \"\", \"\", \"\", [\"16Rnd_9x21_Mag\", 16], [], \"\"],\n    /* uniform */            [\"U_B_CombatUniform_mcam\", [[\"FirstAidKit\", 1], [\"30Rnd_65x39_caseless_mag\", 2, 30], [\"Chemlight_green\", 1, 1]]],\n    /* vest */                [\"V_PlateCarrier1_rgr\", [[\"30Rnd_65x39_caseless_mag\", 3, 30], [\"16Rnd_9x21_Mag\", 2, 16], [\"SmokeShell\", 1 ,1], [\"SmokeShellGreen\", 1, 1], [\"Chemlight_green\", 1, 1]]],\n    /* backpack */            [\"B_AssaultPack_mcamo_AT\",[[\"Titan_AT\", 2, 1]]],\n    /* items */                \"H_HelmetB_light_desert\", \"G_Bandanna_tan\",[],\n    /* items */                [\"ItemMap\", \"\", \"ItemRadio\", \"ItemCompass\", \"ItemWatch\", \"NVGoggles\"]\n]\n```"},{"heading":"Misc","level":4,"markdown":"```cpp\n[\n    [\n        \"arifle_MX_GL_F\",\"muzzle_snds_H\", \"acc_pointer_IR\", \"optic_Aco\",    // Primary weapon, (weapon items) silencer, pointer, optic\n        [\"30Rnd_65x39_caseless_mag\", 30],                                    // Loaded mag in primary muzzle, ammo count\n        [\"1Rnd_HE_Grenade_shell\", 1],                                        // Loaded mag in secondary muzzle, ammo count\n        \"\"    // Bipod\n    ],\n    [],    // Secondary weapon info (see primary above)\n    [    // handGun info (see primary above)\n        \"hgun_P07_F\", \"\", \"\", \"\",\n        [\"16Rnd_9x21_Mag\", 16],\n        [],\n        \"\"\n    ],\n    [    // Uniform\n        \"U_B_CombatUniform_mcam\", // Uniform Type\n        [    // Uniform Items\n            [\"FirstAidKit\", 1],    // Type, count\n            [\"30Rnd_65x39_caseless_mag\", 2, 30] // Magazines are: Type, count, ammo\n        ]\n    ],\n    [    // Vest Info\n        \"V_PlateCarrierGL_rgr\",    // Vest Type\n        [    // Vest Items\n            [\"30Rnd_65x39_caseless_mag\", 3, 30]\n        ]\n    ],\n    [   // Backpack Info\n        \"B_Carryall_ocamo\",                    // Backpack type\n        [    // Backpack Items\n            [\"B_Carryall_khk\", true],          // A backpack inside the backpack (isBackpack is true, so item is defined in CfgVehicles)\n            [\"U_B_CombatUniform_mcam\", false], // A uniform inside the backpack (isBackpack is false, so item is defined in CfgWeapons)\n            // A weapon inside the backpack\n            [[\"arifle_MX_ACO_pointer_F\", \"\", \"acc_pointer_IR\", \"optic_Aco\", [], [], \"\"], 1]\n        ]\n    ],\n    \"H_HelmetSpecB_blk\",                    // Helmet\n    \"G_Tactical_Clear\",                        //Facewear glasses/bandanna etc\n    [\"Binocular\", \"\", \"\", \"\", [], [], \"\"],    // Weapon Binocular (follows same layout as other weapons above)\n    [\"ItemMap\", \"ItemGPS\", \"ItemRadio\", \"ItemCompass\", \"ItemWatch\", \"NVGoggles\"]    // AssignedItems ItemGPS can also be a UAV Terminal\n]\n```"}],"categories":["Arrays"],"groups":["Scripting"]}