Unit Inventory
126 scripting commands. Also as Markdown for agents.
- addBackpackGlobalAdds a backpack to a unit - global variant of addBackpack.
- addBinocularItemAdds weapon item, including magazine, directly to the binocular weapon. This is used for infantry weapons.
- addGogglesCreate a new item and try to link it into goggles (glasses) slot.
- addHandgunItemAdds weapon item, including magazine, directly to the handgunWeapon. This is used for infantry weapons.
- addHeadgearCreates a headgear item and tries to link it to headgear slot. If slot is occupied with another item, the item in the slot will be replaced.
- addItemCreates new item and tries to add it into inventory. Inventory must have enough space to accomodate new item or command will fail.The item can also…
- addItemToUniformCreate new item and store it to soldier's uniform. The item can also be a weapon or a magazine.
- addItemToVestCreate new item and store it to soldier's vest. The item can also be a weapon or a magazine.
- addMagazineAdds a magazine to a person. Infantry units can only carry a specific number of magazines, once the magazine slots are filled (or…
- addMagazineGlobalAdds magazine to a unit regardless of locality. This command can also be used to add magazine to a vehicle, like a static gun, for example.
- addMagazinesAdds multiple magazines to the unit. For cargo containers use addMagazineCargoGlobal command.
- addPrimaryWeaponItemAdds weapon item, including magazine, directly to the primaryWeapon. This is used for infantry weapons.
- addSecondaryWeaponItemAdds weapon item, including magazine, directly to the secondaryWeapon. This is used for infantry weapons.
- addUniformCreate a new uniform and try to link it into uniform slot (given uniform has to be supported by allowedUniforms list of target soldier).
- addVestCreate a new vest and try to link it into vest slot.
- addWeaponAdd a weapon to a unit. For a global version of this command see addWeaponGlobal.
- addWeaponGlobalAdd a weapon to a unit. Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command…
- addWeaponItemAdds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be…
- ammoCheck how many rounds are left in the currently loaded magazine in the given muzzle.
- assignedItemsGet array with assigned items. The resulting Array order is not guaranteed. To check availability of a particular slot item use getSlotItemName. To…
- assignItemAssigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced. See also…
- backpackMagazinesGet array with all magazines from backpack of the given unit.
- backpacksReturns an array of all backpack names a unit has in its inventory, excluding the one it carries on the back.
- binocularReturns class name of currently used binocular weapon.
- binocularItemsReturns array with all items assigned to the binocular weapon except magazines. Use binocularMagazine command for the latter. This command is used…
- binocularMagazineCollects all loaded magazines from all binocular muzzles and returns them in Array, otherwise it returns []. This command is used for infantry…
- canAddChecks if given object can be stored in inventory of given object or any inventory container (uniform, vest, backpack) of given unit.
- canAddItemToUniformChecks if given object can be stored into soldier's uniform.
- canAddItemToVestChecks if given object can be stored into soldier's vest.
- currentMagazineReturns class name of currently loaded vehicle's / unit's magazine.
- currentMagazineDetailReturns description of vehicle's currently loaded magazine, its ammo count (current/default) and its id.
- currentThrowableReturns currently selected throwable (and the muzzle it is loaded into), which will be launched if the user presses <kbd>G</kbd>.
- currentWeaponReturn the name of the currently selected weapon (on the primary turret for vehicles).
- forceAddUniformCreate a new uniform and hard link it into slot (without any restrictions).
- gearIDCAmmoCountReturns ammo count of assigned magazine.
- gearSlotAmmoCountReturns ammo count of assigned magazine.
- gearSlotDataReturns gear slot item name.
- getContainerMaxLoadReturns max load value of given uniform, vest or backpack container. For other types of containers, use maxLoad command
- getCorpseReturns the corpse associated with given weaponholder. When unit is killed and had a weapon, the weapon is placed inside "WeaponHolderSimulated" and…
- getCorpseWeaponholdersReturns primary and secondary weapon holders of a dead unit. If a unit had weapons at the moment of death, primary weapon is dropped into primary…
- getSlotItemNameReturns the name of assigned item in given slot or the empty string.
- getUnitLoadoutReturns a Unit Loadout Array with all assigned items, weapons, containers and their stored items.
- gogglesReturns name of currently used goggles (for NVGoggles use hmd).
- handgunItemsReturns array with all items assigned to the handgunWeapon except magazines. Use handgunMagazine command for the latter. This command is used for…
- handgunMagazineCollects all loaded magazines from all handgunWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry…
- handgunWeaponReturns the name of a unit's handgun (an empty string if there is none).
- hasWeaponChecks if a unit has the given weapon in hands or on back/in holster. Weapons inside unit containers such as vest and backpack are not counted.
- headgearReturns headgear of unit.
- hmdReturns class name of currently used Head Mounted Display. Returns an empty string if the slot is empty.
- isSwitchingWeaponReturns wether or not the unit is in the process of switching weapon.
- isThrowableReturns true if the given magazine is a throwable.
- isUniformAllowedCheck whether given uniform can be dressed by target soldier.
- itemsReturns an array of names of all unit's stored items, including weapons but excluding magazines (see itemsWithMagazines) and assignedItems.
- itemsWithMagazinesReturns combined array including all unit's stored items and all unit's stored magazines and all unit's stored weapons.
- linkItemCreate and assign item to the correct slot. If there is an item in the targeted slot, it gets replaced. See also assignItem.
- loadReturns the percentage of fullness of a unit's cargo. Output is usually in range 0..1, but can be higher after using certain scripting commands (like…
- loadAbsReturns current sum of mass from items stored in all unit's containers, linked items and weapons.
- loadUniformReturns current percentage of mass from items stored in a uniform relative to the maximum capacity of the uniform.
- loadVestReturns current percentage of mass from items stored in a vest relative to the maximum capacity of the vest.
- lockedInventoryGet a vehicle's inventory lock state. Can also be used on a unit's backback (see lockInventory).
- lockInventoryLock or unlock a vehicle's inventory access. This command can also lock backpack a unit is wearing to prevent access by a third party. If set to true…
- magazinesReturns array of type names of all vehicle's magazines. When applied to a unit, the command behaves differently and will omit magazines already…
- magazinesAmmoReturns all vehicle's magazines and their ammo count (also works on supply boxes). When applied to a unit (soldier), the command behaves differently…
- magazinesAmmoFullReturns array of arrays of all unit's or vehicle's magazines with extended information about them. The magazines returned are for primary gunner. If…
- magazinesDetailReturns an array of strings with description of all vehicle's magazines, their ammo count (current/default) and their ids for the primary gunner.
- magazinesDetailBackpackReturns an array with the type names of all the unit's backpack magazines.
- magazinesDetailUniformReturns an array with the type names of all the unit's uniform magazines.
- magazinesDetailVestReturns an array with the type names of all the unit's vest magazines.
- maxLoadReturns maximum load limit for a unit, uniform/vest/backpack containers, vehicle cargo, supply boxes and weapon holders.
- primaryWeaponReturns name of unit's primary weapon. This command will also return a weapon class name if the weapon is not used by the player, for example, it is…
- primaryWeaponItemsReturns array with all items assigned to the primaryWeapon except magazines. Use primaryWeaponMagazine command for the latter. This command is used…
- primaryWeaponMagazineCollects all loaded magazines from all primaryWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry…
- removeAllAssignedItemsUnassigns and deletes all linked items from inventory. The commands operates on assignedItems array, which does not include goggles or headgear but…
- removeAllBinocularItemsRemoves all items from binocular weapon, except magazine.
- removeAllContainersRemoves all containers (vest, uniform, backpack) from the provided unit.
- removeAllHandgunItemsRemoves all items from handgunWeapon, except magazine.
- removeAllItemsRemoves all special items from the unit.
- removeAllItemsWithMagazinesRemoves all itemsWithMagazines from the uniform, vest and backpack. Command essentially clears all unit's containers.
- removeAllMagazinesRemoves all magazines from the unit.
- removeAllPrimaryWeaponItemsRemoves all items from primaryWeapon, except magazine.
- removeAllSecondaryWeaponItemsRemoves all items from secondaryWeapon, except magazine.
- removeAllWeaponsRemoves all weapons and magazines from the given unit. Does not remove items like map, compass, radio (see removeWeapon for this).
- removeBackpackGlobalRemoves backpack from a unit. (even non-local)
- removeBinocularItemRemoves given weapon item, including magazine, from the binocular weapon.
- removeGogglesRemoves goggles from unit (diver goggles for example). This command does not remove NVGoggles. Use unassignItem and removeItem or just unlinkItem for…
- removeHandgunItemRemoves given weapon item, including magazine, from the handgunWeapon
- removeHeadgearRemoves headgear from a unit. If unit has no headgear command quietly fails.
- removeItemRemoves item from the inventory. The removal order by containers is uniform → vest → backpack.
- removeItemsRemoves all items with given class name from the inventory.
- removeMagazineRemove magazine from the unit or static weapon.
- removeMagazineGlobalRemoves the magazine from the unit.
- removeMagazinesRemoves all magazines of given type from the unit. If magazine class does not exist, nothing happens, not even .rpt message, unlike with addMagazine…
- removePrimaryWeaponItemRemoves given weapon item, including magazine, from the primaryWeapon.
- removeSecondaryWeaponItemRemoves given weapon item, including magazine, from the secondaryWeapon.
- removeUniformRemoves uniform from unit.
- removeVestRemoves vest from unit.
- removeWeaponRemove weapon from a unit. The unit must be local to the computer where command is executed. For a global version of this command, see…
- removeWeaponGlobalRemove a weapon from a unit. An attempt to remove a weapon, which is not in unit's possession, is simply ignored.
- removeWeaponItemRemoves magazine from the specified muzzle. It is possible to remove magazine directly from 'Throw' muzzle provided it is configured with…
- secondaryWeaponReturns the name of a unit's secondary weapon (launcher). To detect the weapon which is currently being used by the unit use currentWeapon.
- secondaryWeaponItemsReturns array with all items assigned to the secondaryWeapon except magazines. Use secondaryWeaponMagazine command for the latter. This command is…
- secondaryWeaponMagazineCollects all loaded magazines from all secondaryWeapon muzzles and returns them in Array, otherwise it returns []. This command is used for infantry…
- selectThrowableSelects current throwable, which will be launched if the user presses <kbd>G</kbd>.
- setAmmoSets custom ammo count in the currently loaded magazine of the specified weapon or muzzle.
- setMaxLoadSets maximum load limit for a uniform/vest/backpack containers, vehicle cargo, supply boxes and weapon holders. In MP this command should be executed…
- setUnitLoadoutCreates a loadout from given inventory structure and applies it to a unit. When String for class name is supplied, the command will search…
- setVehicleAmmoDefSets how much ammunition (compared to the configuration of magazines defined in the vehicle's class) the vehicle has. Note that the ammo will only be…
- soldierMagazinesGet array with all magazines of the given unit.
- someAmmoCheck if unit has some ammo.
- throwablesReturns all throwables in unit inventory in currentThrowable format.
- unassignItemUnassigns existing item and tries to put it into inventory. If there is no space in inventory the item simply disappears. See also unlinkItem.
- uniformReturns name of uniform.
- uniformContainerReturns a cargo container of a unit's uniform.
- uniformItemsGet array with all items (of any kind, even weapons) from uniform.
- uniformMagazinesGet array with all magazines from uniform of the given unit.
- uniqueUnitItemsReturns hashmap of all items in units inventory as [classname, count] pairs.
- unlinkItemUnassign and delete existing item from its assigned slot. Nothing happens if the item does not exist or is not assigned. See also unassignItem.
- vestnameof vest.
- vestContainerReturns a cargo container of a unit's vest.
- vestItemsGet array with all items (of any kind, even weapons) from vest.
- vestMagazinesGet array with all magazines from vest of the given unit.
- weaponAccessoriesGet array with all items linked to a given weapon.
- weaponAccessoriesCargoReturns array with all items assigned to the given weapon in given cargo container.
- weaponCargoGet array with weapons from ammo box (or any general weapon holder container).
- weaponsReturns array of names of all unit's weapons.
- weaponsItemsReturns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons.