API ReferenceGE Extensionsflowgraphnodeslogic
Once (Flowgraph Node)
- **Node Name:** `Once`
Overview
- Node Name:
Once - Category:
logic - Behaviour:
{once = true} - File:
extensions/flowgraph/nodes/logic/once.lua
Only lets flow through a single time. After firing once, blocks all subsequent flow until reset.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
reset | flow | Resets the node to allow flow again (impulse) |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Outflow - fires once then blocks (impulse) |
Behavior
init(mgr, ...)- Setsreadyto true.work(args)- If reset is triggered, re-arms the node. Otherwise, if ready and flow is active, outputs flow once and setsreadyto false. All subsequent calls output false until reset._executionStopped()- Re-arms the node (setsreadyto true).
How It Works
The node acts as a one-shot gate. On the first frame that flow arrives, it passes through and the gate closes. The gate stays closed until either:
- The
resetimpulse pin fires - Execution stops and restarts
This is commonly used to trigger initialization logic or one-time events that should not repeat.
Example Usage
-- Trigger a welcome message only once:
-- flow → [Once] → [Show Message "Welcome!"]
-- Even if flow continues, the message only shows once
-- Reset after a level change:
-- Connect level-changed event to reset pin
-- The Once node re-arms and can fire againSee Also
- And (Flowgraph Node) - Related reference
- Boolean Expression (Flowgraph Node) - Related reference
- Branch (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide