BIS fnc loadInventory: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1") |
Lou Montana (talk | contribs) m (Text replacement - "(Optional, default {{hl|[]}})" to "(Optional, default <sqf inline>[]</sqf>)") |
||
(3 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
* [[Array]] in format [<nowiki/>[[Namespace]], [[Group]] or [[Object]], [[String]]] or [[BIS_fnc_saveInventory]]'s output | * [[Array]] in format [<nowiki/>[[Namespace]], [[Group]] or [[Object]], [[String]]] or [[BIS_fnc_saveInventory]]'s output | ||
|p3= [[Array]] - (Optional, default []) array of [[String]]s that define what part of the loadout to ignore, e.g ["weapons", "uniform"] | |p3= [[Array]] - (Optional, default <sqf inline>[]</sqf>) array of [[String]]s that define what part of the loadout to ignore, e.g ["weapons", "uniform"] | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= < | |x1= <sqf>_loadout = [player, configFile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // gives BLUFOR Squad Leader's loadout to player unit</sqf> | ||
|x2= to save and load the inventory: | |x2= to save and load the inventory: | ||
< | <sqf> | ||
[player, [missionNamespace, "TAG_SavedInventory"]] call BIS_fnc_saveInventory; // save it | |||
[player, [missionNamespace, "TAG_SavedInventory"]] call BIS_fnc_loadInventory; // load it | |||
</sqf> | |||
|seealso= [[BIS_fnc_saveInventory]] [[BIS_fnc_exportInventory]] [[BIS_fnc_deleteInventory]] [[setUnitLoadout]] | |seealso= [[BIS_fnc_saveInventory]] [[BIS_fnc_exportInventory]] [[BIS_fnc_deleteInventory]] [[setUnitLoadout]] |
Latest revision as of 18:09, 8 November 2023
Description
- Description:
- Adds a predefined loadout (either via CfgVehicles, CfgRespawnInventory, or a custom inventory saved via BIS_fnc_saveInventory) to a specified unit.
- Execution:
- call
- Groups:
- Inventory
Syntax
- Syntax:
- param call BIS_fnc_loadInventory
- Parameters:
- Object - unit to receive the loadout
- Config or Array - can be one of:
- Array - (Optional, default []) array of Strings that define what part of the loadout to ignore, e.g ["weapons", "uniform"]
- Return Value:
- Boolean
Examples
- Example 1:
- Example 2:
- to save and load the inventory:
[player, [missionNamespace, "TAG_SavedInventory"]] call BIS_fnc_saveInventory; // save it [player, [missionNamespace, "TAG_SavedInventory"]] call BIS_fnc_loadInventory; // load it
Additional Information
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
- Posted on Aug 02, 2020 - 15:21 (UTC)
- Doesn't work for backpacks in backpack, unlike setUnitLoadout.