API · FF: Spectator
FF: Spectator functions
Opt-in spectator service: presets, command broker, UI rendering and optional TFAR/ACRE2 radio integration.
Camera presets 23
The thirteen view modes and the target resolvers that feed them. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
getTargetCameraConversation |
internal | Computes the current conversation camera position, orientation and field of view. | 91 |
getTargetCameraDrone |
internal | Computes the current drone camera position, orientation and field of view. | 24 |
getTargetCameraGear |
internal | Computes the current gear camera position, orientation and field of view. | 22 |
getTargetCameraGroup |
internal | Computes the current group camera position, orientation and field of view. | 65 |
getTargetCameraMappos |
internal | Computes the current mappos camera position, orientation and field of view. | 29 |
getTargetCameraOverhead |
internal | Computes the current overhead camera position, orientation and field of view. | 24 |
getTargetCameraPostmortem |
internal | Computes the current postmortem camera position, orientation and field of view. | 43 |
getTargetCameraShoulder |
internal | Computes the current shoulder camera position, orientation and field of view. | 22 |
getTargetCameraTheater |
internal | Computes the current theater camera position, orientation and field of view. | 75 |
getTargetCameraVehicle |
internal | Computes the current vehicle camera position, orientation and field of view. | 23 |
presetAmbient |
internal | Builds the ambient camera path using the selected target and current scene. | 44 |
presetConversation |
internal | Builds the conversation camera path using the selected target and current scene. | 30 |
presetDrone |
internal | Builds the drone camera path using the selected target and current scene. | 28 |
presetFront |
internal | Builds the front camera path using the selected target and current scene. | 30 |
presetGear |
internal | Builds the gear camera path using the selected target and current scene. | 26 |
presetGroup |
internal | Builds the group camera path using the selected target and current scene. | 25 |
presetMappos |
internal | Builds the mappos camera path using the selected target and current scene. | 16 |
presetOverhead |
internal | Builds the overhead camera path using the selected target and current scene. | 26 |
presetPostmortem |
internal | Builds the postmortem camera path using the selected target and current scene. | 42 |
presetShoulder |
internal | Builds the shoulder camera path using the selected target and current scene. | 25 |
presetTheater |
internal | Builds the theater camera path using the selected target and current scene. | 18 |
presetTopdown |
internal | Builds the topdown camera path using the selected target and current scene. | 20 |
presetVehicle |
internal | Builds the vehicle camera path using the selected target and current scene. | 25 |
Rendering and UI 11
Squad icons, contacts, tracers, markers, medic indicators and the panel. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
adminButton |
internal | Creates a localized command button with data-bound arguments. | 22 |
adminDialog |
internal | Builds localized controls for all spectator modes, maintenance, radio and optional admin code. | 132 |
renderDeadUnits |
internal | Draws dead units for the current viewer. | 59 |
renderEnemyContacts |
internal | Draws enemy contacts for the current viewer. | 39 |
renderFriendlyUnits |
internal | Draws friendly units for the current viewer. | 53 |
renderMapMarkers |
internal | Draws map markers for the current viewer. | 66 |
renderMedicIndicators |
internal | Draws medic indicators for the current viewer. | 27 |
renderModeIndicator |
internal | Draws mode indicator for the current viewer. | 23 |
renderSquadIcons |
internal | Draws squad icons for the current viewer. | 148 |
renderTracerLines |
internal | Draws tracer lines for the current viewer. | 49 |
renderUI |
internal | Draws u i for the current viewer. | 55 |
Administration 2
Curator and administrator maintenance actions. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
adminExecute |
internal | Routes every admin script scope through the same optional server authorization. | 15 |
adminTick |
internal | Shows read-only replicated viewer status as plain text. | 26 |
Service and registration 14
Opt-in service start, session registration, release and body restoration. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
client |
public | Compatibility entry for opt-in automatic role detection and controller bindings. | 11 |
serviceStart |
public | Starts opt-in local/server spectator services without automatically assigning arbitrary viewers. | 40 |
serviceStop |
public | Stops local services and releases server-owned viewer registrations. | 30 |
acceptRegistration |
internal | Starts a viewer only after the server accepts the current local session. | 23 |
canRegisterToken |
internal | Rejects replayed registrations for a closed or newer same-body session. | 12 |
registerRequest |
internal | Authenticates a registration request before scheduling server-local work. | 16 |
registrationReply |
internal | Accepts only server registration replies for the current local body and token. | 13 |
resolveRole |
internal | Resolves spectator roles from server-owned configuration and curator assignment. | 23 |
serverCommand |
internal | Authorizes registered controllers and dispatches only validated viewer operations. | 64 |
serverRegister |
internal | Creates or acknowledges a validated current-body registration on the server. | 32 |
serverRelease |
internal | Restores visibility and releases one server registration without replaying stale sessions. | 25 |
serverTick |
internal | Cleans registrations when player bodies disconnect or change owner. | 18 |
serviceTick |
internal | Binds one HUD controller and registers the current player body with the server. | 41 |
unregisterRequest |
internal | Authenticates release of the calling player session. | 23 |
Command protocol 6
Typed command validation, dispatch and acknowledgement. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
normalizeCommand |
public | Validates the bounded spectator command protocol without executing user data. | 54 |
sendCommand |
public | Requests a typed server-authorized camera or maintenance operation. | 23 |
commandReply |
internal | Reports server acceptance without claiming that remote execution has completed. | 18 |
commandRequest |
internal | Authenticates a network caller before scheduling a typed server command. | 19 |
receiveCommand |
internal | Accepts server camera dispatches only for the current registered viewer. | 20 |
reinitializeSpectator |
internal | Recreates the viewer camera without duplicating workers or changing server body registration. | 19 |
Cleanup 5
Camera, UI, combat handler, radio and state teardown. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
cleanupCamera |
internal | Releases only this spectator's camera and pending transitions. | 18 |
cleanupCombatHandlers |
internal | Removes combat handlers from the current and any tracked squad units. | 22 |
cleanupRadioHandlers |
internal | Removes the radio event registrations owned by this addon. | 29 |
cleanupUIState |
internal | Prunes expired voice and unit-icon caches. | 23 |
endView |
internal | Releases every viewer worker and restores locally owned body, aperture and radio state. | 37 |
Radios and monitors 13
TFAR and ACRE2 registration, channel sync, restoration and monitors. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
checkACRE2 |
internal | Detects optional ACRE and updates the radio integration mode. | 35 |
checkTFAR |
internal | Detects the optional TFAR event API. | 16 |
monitorACE |
internal | Updates casualty and nearby medic tracking. | 52 |
monitorACRE2 |
internal | Refreshes ACRE voice indicators and followed radio channels. | 44 |
monitorLighting |
internal | Updates automatic aperture enhancement with lighting hysteresis. | 78 |
monitorTFAR |
internal | Refreshes TFAR voice indicators and followed radio tuning. | 75 |
radioPairACRE |
internal | Finds target and viewer radios of the same ACRE base type using public APIs. | 22 |
restoreRadios |
internal | Restores personal radio tuning captured before spectator synchronization. | 25 |
resyncRadios |
internal | Rebinds optional radio events and synchronizes existing spectator radios. | 20 |
setupACRE2Handlers |
internal | Registers CBA event handlers for ACRE2 speaking and transmitting events. | 143 |
setupTFAREventHandlers |
internal | Binds local TFAR voice events without broadcasting executable code. | 37 |
syncRadio |
internal | Copies TFAR tuning to existing personal spectator radios, retaining original settings. | 41 |
syncRadioACRE2 |
internal | Synchronizes matching personal ACRE radios while retaining the original channel. | 27 |
Camera control 25
View lifecycle, transitions, night vision, automatic cuts and body handling. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
cam |
alias | Animates the spectator-owned camera using Cinematic's shared driver. | 22 |
applyBodySnapshot |
internal | Restores local viewer body flags and position unless a newer session owns it. | 24 |
applyCommand |
internal | Applies a validated command in local context after server dispatch. | 42 |
beginView |
internal | Starts one accepted viewer with owned workers, body state and mission handlers. | 79 |
cameraTransition |
alias | Starts a cancellable fade or Bezier transition without suspending. | 75 |
checkAutoCut |
internal | Temporarily cuts to distant combat and restores the actual prior mode. | 31 |
ensureCamera |
internal | Acquires only an active viewer camera, initially above the current body. | 26 |
executeApply |
internal | Runs optional administrator code only after a server-authorized dispatch. | 17 |
fade |
internal | Uses a dedicated spectator fade layer without clearing mission titles. | 13 |
healSpectator |
internal | Clears vanilla damage, fatigue and unconsciousness on the active viewer body. | 18 |
killcam |
internal | Shows a cancellable victim/killer shot, then enters postmortem view. | 43 |
manageExecute |
internal | Compatibility entry requesting the explicitly enabled administrator code service. | 12 |
manageSpectatorHide |
internal | Requests server-authorized viewer visibility changes. | 12 |
resetState |
internal | Initializes native viewer state without activating gameplay. | 107 |
resetVariables |
internal | Resets viewing preferences without changing session counters or mission settings. | 17 |
respawnSpectator |
internal | Ends viewer effects before requesting an actual local spectator respawn. | 18 |
restoreBody |
internal | Accepts only server-authorized restoration on the current body owner. | 13 |
setMode |
internal | Selects a camera preset and starts its cancellable transition. | 104 |
setNVGMode |
internal | Applies automatic, aperture, green or disabled camera vision. | 59 |
setNVGStrength |
internal | Updates aperture enhancement strength. | 21 |
trackCombat |
internal | Binds local combat and vehicle handlers and prunes expired combat events. | 69 |
trackDeathsAndRespawns |
internal | Tracks squad casualty and respawn marker transitions. | 29 |
transitionCurrent |
internal | Checks that delayed camera work still owns the active transition. | 14 |
updateCamera |
internal | Updates the continuous camera target using mode-specific smoothing. | 82 |
updateThePlayer |
internal | Resolves a new target and synchronizes camera/radio selection. | 44 |
Input and controls 5
Hotkey binding, key handling and direction sanitising. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
bindControls |
internal | Binds one controller key handler to the current HUD display. | 17 |
controlKey |
internal | Handles spectator mode keys with cancellable one-second cycling. | 44 |
normalizeDirectionDiff |
internal | Normalizes a heading difference across the 360-degree boundary. | 18 |
sanitizeDirection |
internal | Returns a numeric direction or zero for invalid data. | 17 |
unbindControls |
internal | Removes HUD/map bindings and invalidates pending key/map actions. | 22 |
Helpers 10
Squad, colour, icon-state and validation helpers. System internals
| Function | Exposure | Purpose | Lines |
|---|---|---|---|
calculateCameraPosition |
internal | Computes an ASL camera position behind and above a center. | 18 |
calculateSquadCenter |
internal | Computes a weighted squad center, filtering distant outliers. | 101 |
cancelTransition |
internal | Invalidates queued camera steps and stops the current animation. | 22 |
findThePlayer |
internal | Resolves the configured target or a living nonspectator player. | 20 |
getSquad |
internal | Returns the selected unit group members. | 13 |
getTeamColor |
internal | Returns an icon color for the unit assigned team. | 19 |
getUnitIconState |
internal | Chooses the highest-priority medical or voice icon for a unit. | 50 |
requestMapPos |
internal | Waits briefly for the map and binds one cancellable map-position click. | 41 |
slotMatches |
internal | Matches a unit against server-configured objects or Eden variable names. | 15 |
validBodySnapshot |
internal | Checks the shape of a viewer body restoration record. | 15 |
No functions match the filter.