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.
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.
No public module exports - created via _flowgraph_createModule(C).
Purpose
Drift-related gameplay events fire asynchronously. This module captures them into a callback table with a 2-frame time-to-live, allowing flowgraph nodes to poll for recent events during their work cycle.
Key Methods
| Method | Signature | Description |
|---|---|---|
init | () | Calls resetModule(). |
resetModule | () | Initializes all callback slots with ttl = 0. |
onUpdate | () | Decrements TTL on all callbacks each frame. |
getCallBacks | () | Returns the full callbacks table for node polling. |
addCallback | (name, data) | Sets a callback entry with ttl = 2 and optional data payload. |
onDriftSpinout | () | Hook: records a spinout event. |
onDriftCrash | () | Hook: records a crash event. |
onTightDriftScored | (score) | Hook: records a tight drift score event with score value. |
onDonutDriftScored | (score) | Hook: records a donut drift score event with score value. |
onDriftCompletedScored | (data) | Hook: records a completed drift event with addedScore, cachedScore, and combo. |
onDonutZoneReactivated | () | Forwards to gameplay_drift_drift.onDonutZoneReactivated(). |
Hooks
| Hook | Description |
|---|---|
onDriftSpinout | Player spun out during a drift. |
onDriftCrash | Player crashed during a drift. |
onDonutDriftScored | Donut drift score awarded. |
onTightDriftScored | Tight drift score awarded. |
onDriftCompletedScored | Drift combo completed and scored. |
Callback Table Structure
self.callbacks = {
tight = { ttl = 2, data = { score = 1500 } },
donut = { ttl = 0 }, -- expired
spinout = { ttl = 1 }, -- 1 frame remaining
crash = { ttl = 0 },
tap = { ttl = 0 },
scored = { ttl = 2, data = { addedScore = 500, cachedScore = 2000, combo = 3 } },
}
-- Nodes check: if callbacks.tight.ttl > 0 then ... endProperties
| Property | Default | Description |
|---|---|---|
moduleOrder | 0 | Standard priority. |
hooks | {'onDriftSpinout', 'onDriftCrash', 'onDonutDriftScored', 'onTightDriftScored', 'onDriftCompletedScored'} | Subscribed gameplay hooks. |
dependencies | {'gameplay_drift_general'} | Required extensions. |
See Also
- Flowgraph Action Module - Related reference
- Flowgraph AI Recording Module - Related reference
- Flowgraph Button Module - Related reference
- FlowGraph Guide - Guide
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.
Flowgraph File Module
Provides persistent key-value file storage for flowgraph projects. Reads and writes JSON save files in the `settings/cloud/flowgraphSaveData/` directory. Used by nodes to persist state across sessions