RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
And (Flowgraph Node)Boolean Expression (Flowgraph Node)Branch (Flowgraph Node)Bundle (Flowgraph Node)Chainflow Branch (Flowgraph Node)Compare (Flowgraph Node)Edge Detector (Flowgraph Node)Flow Switch (Flowgraph Node)Frame Delay (Flowgraph Node)Once (Flowgraph Node)Flow Interval / Rate Limit (Flowgraph Node)Select (Flowgraph Node)Sequencer (Flowgraph Node)Switch Case (Flowgraph Node)Timed Trigger (Flowgraph Node)Wait (Flowgraph Node)XOR (Flowgraph Node)

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodeslogic

Flow Switch (Flowgraph Node)

- **Node Name:** `Flow Switch`

Overview

  • Node Name: Flow Switch
  • Category: logic
  • File: extensions/flowgraph/nodes/logic/flowSwitch.lua

A toggleable gate that controls whether flow passes through. Can be toggled by clicking in the editor, or controlled programmatically via on/off input pins.

Pin Schema

Input Pins

PinTypeDescription
flowflowInflow for this node
onflowSets the switch to ON when flow arrives
offflowSets the switch to OFF when flow arrives

Output Pins

PinTypeDescription
flowflowOutflow (only when switch is ON and flow is present)

Behavior

  • init(mgr, ...) - Initializes switch to off state.
  • work(args) - Checks on/off input pins to update state, then gates the flow output: flow_out = on AND flow_in.
  • drawMiddle() - Renders a clickable checkbox icon. Clicking toggles the switch state in editor mode.
  • _executionStarted() / _executionStopped() - Restores the stored switch state (preserves editor-set toggle across runs).
  • _onSerialize(res) / _onDeserialized(nodeData) - Persists the switch on/off state.

How It Works

The node maintains an internal on boolean. When the on input pin receives flow, the switch turns on. When the off input pin receives flow, it turns off. The output flow is only active when both the switch is on AND input flow is present.

In the editor, a checkbox icon allows manual toggling. The state set in the editor is preserved across execution start/stop cycles via storedOn.

Example Usage

-- Use as a debug toggle:
-- Click the checkbox in the editor to enable/disable a branch

-- Use as a programmatic gate:
-- Connect a "player entered area" event to the "on" pin
-- Connect a "player left area" event to the "off" pin
-- Flow only passes through while the player is in the area

See Also

  • And (Flowgraph Node) - Related reference
  • Boolean Expression (Flowgraph Node) - Related reference
  • Branch (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Edge Detector (Flowgraph Node)

- **Node Name:** `Edge Detector`

Frame Delay (Flowgraph Node)

- **Node Name:** `Frame Delay`

On this page

OverviewPin SchemaInput PinsOutput PinsBehaviorHow It WorksExample UsageSee Also