FF SUITEArma 3 addons

Danger, protection, supplies, medical effects

CBRN simulation internals

A per-client simulation. Every player machine evaluates its own exposure from fog, zones or a custom provider; there is no authoritative server hazard state, so no network tick is spent on it.

FF_CBRN 8 related functions

1. The local tick

cbrnStart installs a CBA frame handler and ACE actions for the local unit. Each tick obtains a fresh configuration with cbrnGetConfig and exits early when the unit is dead, the soul sequence is running, or the simulation was stopped. Delta time is clamped to five seconds so a frame hitch cannot drain a whole filter.

unit → danger → protection mode → supply drain → exposure → medical + visuals + HUD

2. Danger resolution

  1. Safe predicate — a mission callback can declare an interior safe.
  2. Custom provider — if present it replaces everything below and must return a number without suspension.
  3. Fog layer — when followWorldFog is true, danger is derived from live fogParams scaled by altitude, then mapped between fogDangerStart and fogDangerFull. A ceiling (fogTopASL or fogTopProvider) fades danger out over fogTransition metres.
  4. Zones — each zone contributes full strength inside innerRadius and fades linearly to radius, filtered by min/max ASL. Zone danger and fog danger are combined with max.
  5. Clamp — the result is clamped to maxDanger.

Occupants of a vehicle and Zeus players are treated as sheltered: danger and supply drain are dropped, exposure recovers, load traits and radio range are restored, and the HUD hides. The tick keeps running so effects resume immediately on exit.

3. Protection modes

ModeRequiresDrain
airConnected SCBA backpackairUseRate plus fatigue; multiplied by scbaUseMultiplier.
backpackFilterConnected combination backpack with cartridge minutesFilter rate plus hazard plus a low-stamina bonus based on ACE anaerobic reserve.
maskFilterFitted filter in compatible facewearFilter rate plus hazard; stamina does not change filter use.
none—No protection: exposure accumulates.

cbrnGetProtection tracks the fitted mask family independently of the two visual APR classes, so switching the NATO respirator between filter and no-filter models does not reset the remaining minutes. Backpack supplies are stored on the backpack container, which survives a respawn when the loadout is preserved.

4. Exposure, pain and stamina

Effective danger is reduced by a worn CBRN suit; with filtration and no suit, suitLeak of the danger remains as skin exposure. Exposure accumulates as danger/maxDanger * dt and decays with recoveryRate. Crossing damageThreshold applies damageAmount ACE body damage and subtracts the threshold. Pain is applied per second from painRate, and is skipped for filtered players unless missingSuitPainEnabled is on.

A separate breathing-stress value ramps up while unfiltered and decays after filtration resumes. It drives a loadCoef multiplier (the original trait is restored on stop), a stamina cap and extra blur. The multiplier is recomputed from the current trait, so ACE or another system can recalculate load without being overwritten blindly.

5. State and cleanup

  • Per-unit keys: FF_horror_cbrnExposure, cbrnDanger, cbrnBreathStress, cbrnMaskMinutes, cbrnConnected, cbrnConnectedBackpack, cbrnAppliedLoadCoef.
  • Backpack key: FF_horror_cbrnMinutes — also used by refill stations.
  • Machine state: blur handle, HUD control, previous TFAR coefficient, warning timers, last published danger/protection.
  • cbrnStop destroys the blur, restores TFAR and load traits, clears the HUD and removes inactivity state.

6. Extension points

  • dangerProvider for a reactor, scripted plume or mission-specific sensor network.
  • onDangerChanged / onProtectionChanged for HUDs, audio and mission triggers.
  • Class arrays for gear, so mods with their own respirators and suits work without code changes.
  • cbrnGiveItem and cbrnUseItem for scripted filter installation and refills.

Related functions

↑ Back to top