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

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 Extensionsflowgraph

Flowgraph Base State Node

Base class factory for state-graph nodes. Extends `basenode` with directional transition pins (N/E/S/W) for state-machine-style flowgraphs.

Base class factory for state-graph nodes. Extends basenode with directional transition pins (N/E/S/W) for state-machine-style flowgraphs.


Public Functions

FunctionSignatureReturnsDescription
createBasecreateBase(...)state node instanceCreates a base node via basenode.createBase(...), then applies state-node methods from C and calls C:init(mgr) to set up transition pins.
useuse(mgr, graph, forceId, derivedClass)state node instanceCreates a base state node, overlays derived class fields, runs _preInit(), calls derived init() if overridden, then runs _postInit(). Standard factory for concrete state nodes.

Transition Pin System

State nodes have 4 directional input and 4 directional output transition pins arranged around the node borders:

DirectionInput PinOutput Pin
North (N)tInNtOutN
East (E)tInEtOutE
South (S)tInStOutS
West (W)tInWtOutW

Transition pins are stored in self.transitionPins._in and self.transitionPins._out keyed by direction letter.


Key Methods

MethodDescription
C:init(mgr)Creates 8 transition pins (4 in, 4 out) using the flowgraph/pin module. Pins are of type "transition".
C:customDrawEnd(builder)Draws transition pin pivots around the node rectangle borders. Input pins use arrow indicators; output pins have no arrows. Uses ufe.PushStyleVar for pivot sizing.

Usage Example

-- State nodes are typically created by the manager during deserialization
-- or via the flowgraph editor. Direct usage:

local baseStateNode = require('extensions/flowgraph/baseStateNode')

-- Create a derived state node
local MyState = {}
function MyState:init()
  -- custom state initialization
end
function MyState:work()
  -- state logic per frame
end

local node = baseStateNode.use(mgr, graph, nil, MyState)
-- node now has N/E/S/W transition pins on all 4 sides

Pin Layout Drawing

-- Transition pins are drawn at node borders during customDrawEnd:
-- Input pins (with arrows): N=top-left, W=left-bottom, S=bottom-right, E=right-top
-- Output pins (no arrows):  N=top-right, W=left-top, S=bottom-left, E=right-bottom

-- Link direction between state nodes is determined by relative position:
-- horizontal distance > vertical → E/W pins used
-- vertical distance > horizontal → N/S pins used

Inheritance Chain

basenode.createBase(...)      -- core node with pins, work/trigger, serialization
  └─ baseStateNode.createBase(...)  -- adds transition pins + custom drawing
       └─ baseStateNode.use(...)    -- mixes in derived state behavior

Additional Exports

  • M.createBase - (undocumented)
  • M.use - (undocumented)

See Also

  • Flowgraph Base Module - Related reference
  • Flowgraph Base Node - Related reference
  • Flowgraph Node Builder - Related reference
  • FlowGraph Guide - Guide

Flowgraph Base Node

Core base class for all flowgraph nodes. Defines the complete node lifecycle: initialization, pin management, work execution, drawing, serialization, and context menus. Every flowgraph node inherits f

Flowgraph Node Builder

ImGui node builder that handles the visual layout and rendering of flowgraph nodes. Manages node stages (begin → header → content → input → middle → output → end), pin layout, and header texture rende

On this page

Public FunctionsTransition Pin SystemKey MethodsUsage ExamplePin Layout DrawingInheritance ChainAdditional ExportsSee Also