FF SUITEArma 3 addons

Arming, trigger paths, hit effect

Gravity traps internals

A one-shot trap: arm a prop, and the first player who opens it or the first impact that destroys it fires a single expanding gravity wave with a configurable hit effect.

FF_Horror 3 related functions

1. Arming

// server
[_crate, createHashMapFromArray [
    ["radius", 50], ["duration", 1], ["tolerance", 5],
    ["inventory", true], ["killed", true],
    ["onHit", { params ["_player", "_originASL", "_target"];
                // custom server-side effect for each reached player
    }]
]] call FF_horror_fnc_gravityTrapRegister;
KeyDefaultMeaning
radius50Wave radius in metres.
duration1Seconds the wave takes to reach the radius.
tolerance5Distance tolerance applied when deciding whether a player was reached.
inventorytrueOpening the target's inventory fires the trap.
killedtrueDestroying the target fires the trap.
onHitfaults both firearmsServer callback [player, originASL, target] for every reached player.

A registered object is armed once. gravityTrapUnregister disarms it without firing, and registering an already-armed object replaces its configuration.

2. Trigger paths

  • Inventory open ? the client request is authenticated by gravityTrapRequest before the server allows the inventory and fires the wave.
  • Destruction ? the target's killed handler fires the same wave once.
  • Explicit ? [target] call FF_horror_fnc_gravityTrapTrigger from mission code or a trigger.

All three paths converge on gravityTrapTrigger, which refuses a second fire, so a crate that is opened and then destroyed only fires once.

3. Hit effect

The wave expands from the target's position. As it reaches each player, the server runs the onHit callback once for that player with the wave origin and the trap object. The default effect uses the Utils weapon-fault service to fault both firearms; local-only effects belong in an explicit owner dispatch inside your callback.

4. Authority and cleanup

The registry lives on the server: clients cannot arm, disarm or fire a trap, and the callback never reaches a client. Unregistering, deleting the target or ending the mission clears the registration; a fired trap stays registered but inert until released.

Verified offline: registration, single-fire state and callback dispatch. In-engine object locality and multiplayer behaviour remain a manual check.

Related functions

↑ Back to top