User:ImperialAlex/Sandbox

= @XLA_FixedArsenal = The Arsenal (often called 'virtual arsenal') is a very impressive character/equipment editor for Arma 3 developed by Karel Mořický of Bohemia Interactive. The arsenal has been part of Arma 3 since v1.24 ('Bootcamp' update).

The feature is implemented entirely with SQF functions and UI Cfg with no in-engine components.

This means that it is possible to change aspects of this system by either overriding or copying-and-modifying parts of it. The @XLA_FixedArsenal mods does exactly this. Previous versions would override the arsenal implementation while current versions add a duplicated (and modified) version that works alongside the 'vanilla' version.

Usage (Scripting)
The official Arsenal wiki page gives a good introduction to using the 'vanilla' arsenal in missions.

Restricted Arsenal
The arsenal has an option to restrict the items that are available (N.B. there will always be infinitely many copies available, the restriction limits what items are available, not how many copies of those items are available).

This is done via a system dubbed 'virtual cargo' (internally implemented as arrays of classnames held in the ammocrate's object namespace and/or the mission namespace). This virtual cargo can be manipulated with various functions: Instead of "Weapon" in the function names you can substitute "Weapon", "Magazine","Item", "Backpack" or "Side" (Side is only an option in the modded version and will be explained shortly).

Blacklisting
This feature is exclusive to the modded version. It essentially represents a second "Virtual Cargo" (again, array of classnames stored in object/mission namespace).

Any items present on the blacklist will not be available in the arsenal. This only makes sense in combination when using either the "Side" system or when using "%ALL" in at least one Virtual Cargo type. (!! currently broken in v2.0.2)

The blacklist functions work in the exact same way, simply replace "Cargo" with "Blacklist", i.e. [, ,,] call xla_fnc_addVirtualWeaponBlacklist; will add classes to the blacklist for weapons.

"Side"-system
This is another feature that is only present in the modded version. This systems works by looking up the config of each item in the arsenal and finding it's "side", "faction >> side" or "xla_arsenal_side" (in inverse order of precedence) attribute.

Possible values for these are east/west/indep/civillian/neutral/enemy/friendly/logic or "no side". More accurately the possible values are the interal integer equivalents of these sides.

While east/west/indep and civillian should be fairly straight foward, the other might require some explanation.

"friendly" (the side that 'captives' are assigned to) is used for items that are common to all 'real' sides. (e.g. compass, map, etc).

"enemy" could (but isn't currently) be used to represent items not used by any of the 'real' sides. "neutral" and "logic" are not used in this mod but nothing is stopping you or mod authors from defining things onto these sides.

Sides can be black/whitelisted like normal equipment items. Instead of their names, you'll have to pass them in as numbers (enclosed as a string).

E.g. to allow all "west" and "common"/"friendly" side equipment in "ammo_crate" (globally, without adding arsenal addaction): //Example for "west" and "common"/"friendly" equipment: [ammo_crate,["1","6"],true,false] call xla_fnc_addVirtualSideCargo;

The side-based "allow/deny" decision is always overruled by individual classname whitelist/blacklist. // Pseudo code, example where "item" is of type weapon // Not actual implementation. Uses fake commands like 'getSide' which don't work on classnames _item_side_decision = ( (getSide _item) in SIDE_CARGO || "%ALL" in SIDE_CARGO) && !( (getSide _item) in SIDE_BLACKLIST || "%ALL" in SIDE_BLACKLIST); _item_decision = if (_item_side_decision) then { !( (_item in WEAPON_BLACKLIST) || ("%ALL" in WEAPON_BLACKLIST)) } else { (_item in WEAPON_CARGO) || ("%ALL" in WEAPON_CARGO) }; Note that in all versions up to and including v2.0.2 the check for "%ALL" is only present in the SIDE_CARGO/SIDE_BLACKLIST conditions but mission from the _item_decision.

Warning: "Side"-system and mods
Since not many equipment items have these set by default the mod adds "xla_arsenal_side" attributes to most of the vanilla equipment. Mods that aren't specifically designed to work with this system will usually have no such attributes.

If a modded item inherits from a vanilla item it might end up with an inherited side as well which in many cases will be nonsensical. (I.e. if an RPG launcher from a mod inherits from the NLAW it will inherit the "Blufor" side).

You can use the blacklisting/whitelisting feature to remove/add any items that were wrongly allowed/denied by the "side" system. Alternatively, you can ask mod authors for support of this feature or implement it yourself by creating a compatibility pbo.