API ReferenceGE Extensionsflowgraphnodesvehicle
Timeline Replay
- **Node Name:** `Timeline Replay`
Overview
- Node Name:
Timeline Replay - Category: (duration behaviour)
- File:
extensions/flowgraph/nodes/vehicle/replay.lua
Plays a vehicle replay file at a specific time within a flowgraph timeline. This is a prototypical node and may not work correctly in all cases.
Todo: Prototypical node, not working correctly in all cases.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
filename | string | Replay filename to load |
vehId | number | ID of vehicle to replay |
Legacy Pin Mapping
in.vehID→vehId
Internals
Key Methods
| Method | Description |
|---|---|
init() | Sets up timeline (5-10 range), initializes replayName |
work() | Checks startReplay/stopReplay flags and loads/stops replay accordingly |
_executionStopped() | Stops any active replay via core_replay.stop() |
onTimelineBegin(globalTime, localTime) | Sets the startReplay flag |
onTimelineEnd(globalTime, localTime) | Sets the stopReplay flag |
drawCustomProperties() | UI for loading and selecting replay files |
drawMiddle(builder, style) | Displays replay name and flag states in the node |
Custom Properties UI
The node provides an ImGui interface to:
- Load available replays via
core_replay.getRecordings(). - Select a replay from a dropdown combo box.
- The selected replay filename is stored in
self.replayName.
How It Works
- The node uses the flowgraph timeline system (
_setupTimeline(5, 10)). - When the timeline begins,
onTimelineBegin()sets astartReplayflag. - On the next
work()tick, the replay is loaded viacore_replay.loadFile()using either the pin filename or the UI-selected replay name. - When the timeline ends,
onTimelineEnd()sets astopReplayflag. - On the next tick,
core_replay.stop()halts the replay. - If execution is stopped entirely, the replay is also stopped.
Usage Example
-- Load and play a replay file:
core_replay.loadFile("/path/to/replay.rpl")
-- Stop replay:
core_replay.stop()
-- Get available recordings:
local recordings = core_replay.getRecordings()
for _, r in ipairs(recordings) do
print(r.filename)
endKey Dependencies
core_replay.loadFile(path)- loads and plays a replay filecore_replay.stop()- stops the active replaycore_replay.getRecordings()- lists available replay recordings- Flowgraph timeline system (
_setupTimeline,onTimelineBegin,onTimelineEnd)
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide