Class conversion and policy ownership
Faulty vision equipment internals
Replacement optic classes with NV and thermal removed. Conversion is a loadout rewrite performed by the unit's owner, with one continuous policy per mission.
1. Classes
CfgWeapons in Utils defines FF_Horror_<class>_Faulty for every supported NVG, scope and
handheld optic. They keep the stock model, reticle, magnification and normal vision; NV/thermal modes are removed and
ranging/designation still work. Scopes use CBA Joint Rails.
2. Mapping
faultyVisionMap builds the vanilla → faulty class table once and caches it. One mapping is used for worn
NVGs, mounted scopes, handheld optics and items inside uniform, vest and backpack containers.
3. Conversion
faultyVisionReplace runs on the owning machine, reads the unit loadout, replaces supported entries, and
re-applies only when something actually changed. Ammo counts and the rest of the loadout are preserved. Weapon switches
defer conversion for up to 30 seconds; continuous mode retries on the next scan.
4. Policy
| Action | Effect |
|---|---|
| 0 Replace now | One pass over the target set. |
| 1 Continuous | Interval scan that also catches respawns, joiners and new pickups. |
| 2 Stop | Ends the policy; faulty items stay in place. |
| 3 Stop and restore | Converts supported faulty items back to vanilla. |
A generation counter cancels pending conversions when a new action replaces the policy, so two Zeus clicks cannot interleave half-applied loadouts.
5. Out of scope
Crates, vehicle cargo, dropped items, integrated helmet optics, vehicle sensors, weapon-integrated sights and third-party devices are not converted. Items taken from cargo convert on the next continuous scan if the unit is targeted.
Related functions
FF_utils_fnc_faultyVision— [action, audience, units, nvg, scopes, binoculars, interval] action: 0 once, 1 continuous,FF_utils_fnc_faultyVisionReplace— Runs only where a unit is local. Rewrites class strings, preserving loadout data.FF_utils_fnc_faultyVisionMap— Exact config-driven mapping; never replace unknown/modded equipment by ancestry.FF_utils_fnc_faultyVisionTick— Per-unit periodic scan used by continuous mode. Converts supported worn, mounted and storeFF_utils_fnc_moduleFaultyVision— Eden module callback. Normalizes action/targets/categories and starts or stops the faulty-