API ReferenceGE Extensionsflowgraphnodeslogic
Wait (Flowgraph Node)
- **Node Name:** `Wait`
Overview
- Node Name:
Wait - Category:
logic - Behaviour:
{duration = true, once = true} - File:
extensions/flowgraph/nodes/logic/wait.lua
Delays flow by a specified time duration. Once flow arrives, waits the configured number of seconds before passing flow through. Requires constant flow input.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
reset | flow | Resets the timer (impulse) |
duration | number | Time to wait in seconds (default: 3, hardcoded) |
useDtSim | bool | Use simulation dt instead of real dt (default: false, hidden) |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Continuous flow after wait completes |
impulse | flow | One-shot flow on wait completion (impulse) |
Behavior
init(mgr, ...)- Resets timer to 0, not running._executionStarted()- Resets timer and running state.work(args)- Clears impulse output. When flow starts and timer hasn't completed, begins timing. Reset pin clears the timer. Each frame, increments timer by dt (real or sim). When timer exceeds duration, outputs flow and fires the one-shot impulse.updateTimer()- Adds dt to timer; when timer >= duration, stops running and fires impulse.drawMiddle()- Shows a progress bar and reset button.
How It Works
The node starts timing when flow first arrives. It uses either real time (dtReal) or simulation time (dtSim) based on the useDtSim flag. Once the timer reaches the configured duration:
- The
flowoutput becomes active (stays active as long as input flow continues) - The
impulseoutput fires once
The timer does not auto-reset - once complete, flow passes through continuously. Use the reset pin to restart the wait cycle.
Example Usage
-- Wait 5 seconds before showing a UI element:
-- duration = 5
-- flow → [Wait] → impulse → [Show UI]
-- Using simulation time (pauses when game pauses):
-- useDtSim = true
-- duration = 10
-- Waits 10 seconds of in-game timeAdditional Methods
C:_onDeserialized(res)
Called after the node is deserialized (loaded from file). Restores runtime state from saved data.
Parameters:
res
See Also
- And (Flowgraph Node) - Related reference
- Boolean Expression (Flowgraph Node) - Related reference
- Branch (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide