Table of Contents

Save Arsenal Loadout on Arsenal Exit

Most of the time, an operative is satisfied with the loadout they created after using an arsenal. In these cases, the operative would prefer to spawn as their desired loadout rather than use the arsenal again. The script was created for this demand.

Make sure ACE3 and CBA is installed.


Scripts

initPlayerLocal.sqf
// Save loadout on arsenal exit
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
 
ARSENAL_DISPLAY_ID = ["ace_arsenal_displayClosed", {
	[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
	hint "Loadout Saved for Respawn";
}] call CBA_fnc_addEventHandler;
onPlayerRespawn.sqf
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;

Explanation

The initPlayerLocal.sqf script runs only on a player's machine. It runs once as soon as the player joins the mission. Using the BIS_fnc_saveInventory function, the player's initial loadout is saved to the missionNamespace in the variable inventory_var. inventory_var is overwritten each time a player closes the ACE3 arsenal. When the player respawns, their inventory_var is loaded again.