API ReferenceGE Extensionsflowgraphnodesutil
Timed Sequence
- **Node Name:** `Timed Sequence`
Overview
- Node Name:
Timed Sequence - Category:
once_f_duration - File:
extensions/flowgraph/nodes/util/timedSequence.lua
Runs a configurable sequence of timed sections in order. Each section has a duration, and the node outputs flow signals when each section starts, is active, and completes. Finishes after all sections are done.
Pin Schema
Dynamic Pins (per section i)
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
duration_i | number | 5 | Duration of section i in seconds (hardcoded) |
Output Pins
| Pin | Type | Description |
|---|---|---|
start_i | flow | Impulse when section i begins |
active_i | flow | Active flow while section i is running |
complete_i | flow | Impulse when section i is completed |
Pins are dynamically created/removed based on the section count set in properties.
Internals
Key Methods
| Method | Description |
|---|---|
init() | Initializes counters and timing state |
postInit() | Sets up initial pin count (default 1 section) |
_executionStarted() | Resets all timing state |
drawCustomProperties() | ImGui UI to change section count |
updatePins(old, new) | Adds or removes pin groups for sections |
workOnce() | Starts the timed sequence |
work() | Advances time, tracks current section, fires flow signals |
onNodeReset() | Resets time and duration state |
Timing Logic
- On start, computes total
endTimeby summing all section durations. - Each frame, increments
self.timebyself.mgr.dtSim. - Iterates through sections, accumulating elapsed time to find the current active section.
- Fires
start_iimpulse on section transitions,active_iwhile current, andcomplete_ion completion. - Sets duration state to
'finished'when total time is reached.
Serialization
Saves and restores count and mode. On deserialization, rebuilds dynamic pins via updatePins().
How It Works
- Configure the number of sections in the property panel.
- Set a
durationfor each section. - When flow arrives, the sequence begins (
workOnce→started). - The node tracks elapsed simulation time and transitions through sections.
- Each section fires
start,active, andcompleteflow signals at appropriate times. - After the last section completes, the node's duration state becomes
finished.
Usage Example
-- 3-section countdown sequence:
-- Section 1: duration_1 = 3 (3 second "ready")
-- Section 2: duration_2 = 2 (2 second "set")
-- Section 3: duration_3 = 1 (1 second "go")
-- Connect start_1 → display "Ready"
-- Connect start_2 → display "Set"
-- Connect start_3 → display "Go!"
-- Connect complete_3 → start race logic
-- Use active_i for continuous effects during a section
-- Use start_i for one-shot triggers at section boundariesKey Dependencies
self.mgr.dtSim- simulation delta time for advancing the sequence
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide