BIS fnc loadInventory: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\|= " to " ") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|0.58 | |0.58 | ||
|gr1 = Inventory | |gr1 = Inventory | ||
| Adds a predefined loadout (either via CfgVehicles, CfgRespawnInventory, or a custom inventory saved via [[BIS_fnc_saveInventory]]) to a specified unit. | | Adds a predefined loadout (either via CfgVehicles, CfgRespawnInventory, or a custom inventory saved via [[BIS_fnc_saveInventory]]) to a specified unit. | ||
| param call [[BIS_fnc_loadInventory]]; | | param call [[BIS_fnc_loadInventory]]; | ||
|p1= [[Object]] - Unit to receive the loadout. | |p1= [[Object]] - Unit to receive the loadout. | ||
|p2= [[Config]] - Config entry of loadout found in either CfgVehicles or CfgRespawnInventory, OR: | |p2= [[Config]] - Config entry of loadout found in either CfgVehicles or CfgRespawnInventory, OR: | ||
* [[Array]] in format [ < [[Namespace]], [[Group]] or [[Object]] >, [[String]] ] or [ output of [[BIS_fnc_saveInventory]] ] - usable with inventories saved via [[BIS_fnc_saveInventory]]. | * [[Array]] in format [ < [[Namespace]], [[Group]] or [[Object]] >, [[String]] ] or [ output of [[BIS_fnc_saveInventory]] ] - usable with inventories saved via [[BIS_fnc_saveInventory]]. | ||
|p3= [[Array]] - Array of [[String|Strings]] that define what part of the loadout to ignore. Example "weapons", "uniform". ''Optional parameter''. | |p3= [[Array]] - Array of [[String|Strings]] that define what part of the loadout to ignore. Example "weapons", "uniform". ''Optional parameter''. | ||
| [[Boolean]] | | [[Boolean]] | ||
|x1= <code>loadout = [player,configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // Gives loadout of BLUFOR Squad Leader to player unit.</code> | |x1= <code>loadout = [player,configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // Gives loadout of BLUFOR Squad Leader to player unit.</code> | ||
| [[BIS_fnc_saveInventory]][[BIS_fnc_exportInventory]][[BIS_fnc_deleteInventory]][[setUnitLoadout]] | | [[BIS_fnc_saveInventory]][[BIS_fnc_exportInventory]][[BIS_fnc_deleteInventory]][[setUnitLoadout]] | ||
}} | }} |
Revision as of 23:11, 17 January 2021
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 - Config entry of loadout found in either CfgVehicles or CfgRespawnInventory, OR:
- Array in format [ < Namespace, Group or Object >, String ] or [ output of BIS_fnc_saveInventory ] - usable with inventories saved via BIS_fnc_saveInventory.
- Array - Array of Strings that define what part of the loadout to ignore. Example "weapons", "uniform". Optional parameter.
- Return Value:
- Boolean
Examples
- Example 1:
loadout = [player,configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // Gives loadout of BLUFOR Squad Leader to player unit.
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
Bottom Section
- Posted on August 8, 2015 - 17:18 (UTC)
- Drunken Officer
-
to save and load the inventory
//--- save it
[player, [missionNamespace, "Var_SavedInventory"]] call BIS_fnc_saveInventory;
//--- load it
[player, [missionNamespace, "Var_SavedInventory"]] call BIS_fnc_loadInventory;
- Posted on August 2, 2020 - 15:21 (UTC)
- Ilias38rus
- Doesn't work for backpacks in backpack, unlike setUnitLoadout.