Flowgraph Camera Module
Manages camera path playback for flowgraph projects. Loads, stores, plays, and cancels camera paths. Used for cinematic sequences, mission intros, and scripted camera movements.
Manages camera path playback for flowgraph projects. Loads, stores, plays, and cancels camera paths. Used for cinematic sequences, mission intros, and scripted camera movements.
No public module exports - created via _flowgraph_createModule(C).
Purpose
Provides camera path management for flowgraph nodes. Paths are loaded from .camPath.json files or created programmatically. The module tracks active path playback, loop state, and completion counts.
Key Methods
| Method | Signature | Description |
|---|---|---|
init | () | Creates variable storage, calls clear(). |
clear | () | Resets all stored paths, active path state, and ID counter. |
findPath | (name) | Loads a camera path by name from the manager's relative paths. Caches by name. Returns path ID. |
addCustomPath | (name, path, force) | Registers a programmatically created path. Returns path ID. |
getPath | (id) | Returns the stored path data for an ID. |
getPathDuration | (id) | Returns the duration (last marker time) of a path. |
isPathComplete | (id) | Returns true if the given path is active and has completed at least once. |
startPath | (id, loop) | Starts camera path playback via core_paths.playPath(). Switches to game camera if in free camera mode. |
cancelPathCam | () | Stops the current camera path via core_paths.stopCurrentPath(). |
endActivePath | (id) | Stops the active path if it matches the given ID. |
restartActivePath | (id) | Restarts the active path from the beginning. |
finishedPath | () | Callback when a path completes. Increments completion count; cancels if not looping. |
executionStopped | () | Cancels any active path and clears state. |
Path Lifecycle
findPath("intro_cam") → loads from file → stored with ID
│
startPath(id, loop)
│
core_paths.playPath(path, 0, initData)
│
┌────┴────┐
│ Playing │ ← finishedPath() callback
│ │
└────┬────┘
│
loop? → restart : cancelPathCam()Properties
| Property | Default | Description |
|---|---|---|
moduleOrder | -500 | Very early priority (camera should be set up before other modules). |
storedPaths | {} | {[id] = pathData} - loaded camera paths. |
pathIds | {} | {[name] = id} - name-to-ID lookup cache. |
activePathId | nil | ID of the currently playing path. |
loopActivePath | nil | Whether the active path should loop. |
completions | nil | Number of times the active path has completed. |
Usage from Nodes
-- From a flowgraph node's work() function:
local camModule = self.mgr:getModule("camera")
local pathId = camModule:findPath("missions/intro/flyover")
camModule:startPath(pathId, false) -- play once
-- Check completion:
if camModule:isPathComplete(pathId) then
self.pinOut.done.value = true
endAdditional Exports
getFreeId()
- Returns:
any
getUniqueName(prefix)
- prefix -
any - Returns:
any
getCmd(id)
- id -
any - Returns:
any
afterTrigger()
idCounter-number- (see source)
See Also
- Flowgraph Action Module - Related reference
- Flowgraph AI Recording Module - Related reference
- Flowgraph Button Module - Related reference
- FlowGraph Guide - Guide
Flowgraph Button Module
Manages custom UI buttons displayed during flowgraph execution. Nodes can create, configure, and respond to button clicks through this module. Button state is sent to the UI via `guihooks.trigger('Cus
Flowgraph Drift Module
Receives drift gameplay callbacks (spinout, crash, scoring events) and exposes them to flowgraph nodes via a TTL-based callback system. Bridges `gameplay_drift_general` events into the flowgraph.