FF SUITEArma 3 addons

Roles, presets, commands, radios, UI

Spectator suite internals

A native opt-in spectator service: thirteen camera presets, six overlay layers, a typed command broker, night vision control, body restoration and optional TFAR/ACRE2 radio sync.

FF_Spectator 6 related functions

1. A separate component

Spectator is the seventh mod. It requires Core, Cinematic and CBA; ACE, ZEN, TFAR and ACRE are optional. Loading it registers functions and one mission-end cleanup handler but activates no cameras, and it never touches a mission that does not enable it. Camera movement is delegated to FF_cinematic_fnc_animateCamera with a Spectator-owned camera, which is what makes every transition cancellable.

2. Roles and registration

// server and participating clients
[true, "auto", createHashMapFromArray [
    ["slots", [myViewerUnit]],
    ["controllerPolicy", "all"],
    ["syncRadios", true]
]] call FF_spectator_fnc_serviceStart;

Or enable the CBA setting FF: Spectator / Enable spectator service. Eligibility is resolved on the server: an explicit VirtualSpectator_F, an Eden unit named spectator, or a unit listed in slots. A viewer must be on foot. In auto mode the remaining permitted players become controllers, who keep their own body and normal view; explicit viewer or controller requests are also accepted.

KeyDefaultMeaning
slots[]Viewer unit objects or Eden variable-name strings
controllerPolicy"all"all, curators or list
controllers[]Extra controllers for the list policy
adminUIDs[]Administrators for maintenance and optional code
allowCodefalseExplicitly enables curator/administrator code requests
targetnullClient: initial target object
preferredUIDemptyClient: preferred body to follow
syncRadiostrueClient: mirror personal radio tuning
killcam / killcamSlowMotiontrue / falseSingle player only for slow motion

Each client registers its current body and a monotonic session token. The server validates ownership and role, stores the original hidden state plus a restoration record, and only then acknowledges; an unacknowledged viewer never parks its body. Replacement bodies register independently. Stale sessions and older commands cannot revive an ended view, and disconnect cleanup restores visibility and sends body restoration to the current owner.

3. Presets

Thirteen modes, each with a getTargetCamera* resolver and a preset* entry point:

Following something

  • group — squad-centred view with calculateSquadCenter
  • shoulder, front, gear, vehicle
  • drone — UAV sensor-style with its own radius, height and speed
  • conversation — two-body framing

Free and scripted views

  • overhead, top-down, theater, ambient
  • map position — pick a ground position on the map
  • postmortem — the body as it fell
  • killcam — the shot that killed, optional slow motion

Automatic cuts remember the real prior mode; after another camera command, restoration is abandoned rather than fighting the newer intent. Fades use their own display layer, and every pending transition can be invalidated through a generation token (cameraTransition, transitionCurrent, cancelTransition).

4. Command broker

[["setMode", ["shoulder"]], ["toggleAutoCuts", []], ["uiToggle", []],
 ["setPlayer", [_unit]]] call FF_spectator_fnc_sendCommand;

Signatures: [operation, arguments, viewerBodies] call FF_spectator_fnc_sendCommand from a registered local client. An empty audience means "all viewers" for a controller and "only me" for a viewer. normalizeCommand rejects unknown operations, wrong argument counts and code-valued payloads; serverCommand, applyCommand, commandRequest, commandReply and receiveCommand carry the validated traffic.

Operations: setMode (plus radius/height/speed for drone), setPlayer, setMapPos, setNVGMode (auto/aperture/thermal/off), setNVGStrength 0–1, uiToggle, toggleAutoCuts, toggleAutoNVG, reinitializeSpectator, resyncRadios, resetVariables, healSpectator, respawnSpectator, manageSpectatorHide, and execute with a scope of local/spectator/server/global. Maintenance targets need curator or configured-admin permission — except that a viewer may maintain its own body — and code always needs both authorization and allowCode = true. Requests are bounded and rate limited; camera dispatches are server-only and checked against the receiving viewer body, token and server sequence.

5. UI and overlays

  • renderUI, renderModeIndicator, adminDialog, adminButton — the panel, mode readout and admin tools.
  • renderSquadIcons, renderFriendlyUnits, renderEnemyContacts, renderDeadUnits, renderMedicIndicators, renderTracerLines, renderMapMarkers — the six overlay layers plus map markers.
  • monitorLighting, setNVGMode, setNVGStrength — night vision policy and strength.
  • bindControls / unbindControls / controlKey — hotkeys F1 group, F2 gear, F3 drone, F4 shoulder, F5 theater, F6 overhead, F7 conversation, F8 cycle map/ambient/front/top-down with a one-second confirmation, F9 track this player, F10 map position, F11 panel.
  • trackCombat, trackDeathsAndRespawns, checkAutoCut — automatic switching and combat tracking.

Status text is read-only and renders names literally. Server replies report dispatch, never that remote code completed.

6. Radio integration

TFAR registration is local per addon client and broadcasts no executable function; ACRE CBA event IDs and TFAR object bindings are retained for explicit removal. Synchronization mirrors existing personal radios and records their original tuning for restoration — it never removes gear. TFAR vehicle radios are excluded because they are shared with the crew, and ACRE matches base radio types before copying channels, since equal channel numbers do not imply equal presets. Combat-handler owners are tracked even when the selected squad changes.

7. Lifecycle, policies and limits

  • Cleanup: cleanupCamera, cleanupUIState, cleanupCombatHandlers, cleanupRadioHandlers, restoreBody, restoreRadios, endView, serviceStop.
  • Restrictive CfgRemoteExec: allow registerRequest, unregisterRequest and commandRequest to the server; registrationReply, restoreBody, receiveCommand and commandReply to clients; executeApply only for the enabled administrator feature.
  • Alias entry points (FF_SPECT_main_fnc_init, client, cam, adminDialog) call the same implementation. Command traffic goes through sendCommand, which binds every request to its requester.

Verified: config and PBO paths, unique registration, local references, all 68 named camera methods, SQF parsing, and pure protocol tests for command schemas, maintenance classification, session replay and body snapshots. Not verified: any in-engine camera, radio, UI or multiplayer behaviour.

Related functions

↑ Back to top