API ReferenceGE Extensionsflowgraphnodeslogic
Branch (Flowgraph Node)
- **Node Name:** `Branch`
Overview
- Node Name:
Branch - Category:
logic - File:
extensions/flowgraph/nodes/logic/branch.lua
Routes flow to either the True or False output pin based on a boolean condition. The fundamental if/else construct for flowgraphs.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
condition | bool | The condition to be checked against |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Passthrough outflow (hidden) |
True | flow | Outflow when the condition is true |
False | flow | Outflow when the condition is false |
Behavior
work()- When flow is active, passes flow through and routes toTrueorFalsebased on the condition value. When no flow, all outputs are false.
How It Works
This is the standard conditional branching node. When flow arrives and the condition is truthy, True outputs flow and False is suppressed (and vice versa). The hidden flow pin always passes through the input flow regardless of condition.
Example Usage
-- In a flowgraph:
-- Connect a boolean check (e.g., "is player near?") to the condition pin
-- Connect True to the "open door" action
-- Connect False to the "keep door closed" action
-- Equivalent Lua logic:
if condition then
-- True branch
else
-- False branch
endSee Also
- And (Flowgraph Node) - Related reference
- Boolean Expression (Flowgraph Node) - Related reference
- Bundle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide