FF SUITEArma 3 addons

Policy merge, arsenal build, restore

Wardrobe and loadout policy internals

A server-published policy plus a client-side arsenal builder. Missions can offer a full arsenal, a curated one or the mission loadout, with electronics filtering and loadout preservation on re-entry.

FF_Utils 6 related functions

1. Policy resolution

wardrobeGetConfig starts from hard defaults, then merges, in order: server-published FF_horror_wardrobePolicy, mission FF_horror_wardrobeConfig, and local overrides passed by the caller. Every key is type-checked against its default, so a malformed mission value is ignored instead of breaking the wardrobe. Aliases are normalized (restricted → mission, all → full, booleans → once/never).

wardrobeSetConfig publishes a policy from the server and raises the revision counter; clients clear their caches and re-apply starting gear. wardrobeReset does the same locally.

2. Opening

wardrobeOpen runs with spawn: it validates the destination, plays the optional VR effect, blackouts for blackout seconds, teleports the player, optionally restores a saved loadout, sanitizes electronics, builds the item list and opens ACE Arsenal. Any exit path restores blackout and re-enables entry.

3. Item list construction

mode pool + core items + additional − exclusions → compatibility filter → itemFilter callback

autoCompatible keeps only items that fit the current weapon and slot set, which prevents the arsenal from offering unusable magazines. In mission mode the mission loadout, NATO defaults and (optionally) custom gear form the pool. Electronics restrictions remove configured classes, prefixes and their exceptions.

4. Handlers and saved state

wardrobeRegisterHandlers installs the ACE arsenal close handler and self-actions. Saved loadouts are kept in mission namespace so preserveLoadout can be never, once or always. The refresh script keeps the arsenal in sync when a policy changes mid-session.

5. Extension points

  • itemFilter — code returning false to hide a class (rank checks, story gates).
  • canEnter — code returning false to refuse entry (time of day, location, alive helpers).
  • defaultDestination — position array or marker name; the default is the player's current position.
  • moduleWardrobe for an editor access point; moduleWardrobeSettings for a one-per-mission policy.

Related functions

↑ Back to top