API ReferenceGE Extensionsflowgraphnodeslogic
Flow Interval / Rate Limit (Flowgraph Node)
- **Node Name:** `Flow Interval`
Overview
- Node Name:
Flow Interval - Category:
logic - File:
extensions/flowgraph/nodes/logic/rateLimit.lua
Lets flow through at a regular time interval. Fires instantly the first time, then throttles subsequent flow to the configured frequency or duration.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
reset | flow | Resets the timer (impulse, hidden) |
dt | number | Custom delta time (hidden; uses simulation dt if unset) |
input | number | Frequency (Hz) or duration (seconds) depending on asDuration (default: 1, hardcoded) |
reverseHit | bool | If true, flow fires at end of cycle; if false, at beginning (default: true) |
asDuration | bool | Treat input as duration instead of frequency (default: false, hidden) |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Outflow at the configured interval (impulse) |
Legacy Pin Mapping
| Old Name | New Name |
|---|---|
fps | frequency |
interval | frequency |
Behavior
init()- Resets timer and previous frequency tracker._executionStarted()- Resets timer state.work()- Decrements internal timer by dt each frame. When the timer reaches 0, outputs a flow impulse and resets the timer. IfasDurationis true, timer is set to the input value directly; otherwise it's set to1/frequency. Reset pin or frequency change restarts the cycle.
How It Works
The node maintains an internal countdown timer. Each frame it subtracts the delta time. When the timer hits zero, it emits a flow pulse and reloads the timer. The reverseHit flag controls whether the first pulse happens immediately (false) or after the first full interval (true).
The middle of the node displays a progress bar showing time remaining in the current cycle.
Example Usage
-- Emit flow every 2 seconds:
-- input = 0.5 (0.5 Hz = every 2 seconds)
-- Or using duration mode:
-- asDuration = true
-- input = 2 (fire every 2 seconds)
-- Rate-limit an expensive check to 10 times per second:
-- input = 10 (10 Hz)
-- Connect the check logic to the outputAdditional Methods
C:drawMiddle(builder, style)
Custom ImGui drawing in the middle section of the node in the editor.
Parameters:
builderstyle
See Also
- And (Flowgraph Node) - Related reference
- Boolean Expression (Flowgraph Node) - Related reference
- Branch (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide