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 Module

Base class factory for flowgraph modules. Modules are manager-level components that provide shared state and services to flowgraph nodes (e.g., button management, camera paths, file I/O).

Base class factory for flowgraph modules. Modules are manager-level components that provide shared state and services to flowgraph nodes (e.g., button management, camera paths, file I/O).


Public Functions

FunctionSignatureReturnsDescription
createBasecreateBase(...)module instanceCreates a new base module instance. Sets up the metatable, calls init(mgr) with the provided arguments.
useuse(mgr, derivedClass)module instanceCreates a base instance, then overlays all fields from derivedClass onto it. If the derived class defines its own init, calls it after merging. This is the standard factory for creating concrete modules.

Base Class (C) Methods

MethodSignatureDescription
initinit(mgr)Stores the manager reference as self.mgr. Called during construction.
clearclear()No-op placeholder for module cleanup. Override in derived modules.
onUpdateonUpdate(dtReal, dtSim, dtRaw)Per-frame update hook. Override for continuous logic.
executionStoppedexecutionStopped()Called when flowgraph execution stops. Override for teardown.
executionStartedexecutionStarted()Called when flowgraph execution begins. Override for setup.
onClearonClear()Delegates to executionStopped().

Base Class Properties

PropertyTypeDescription
moduleOrdernumberSorting priority (lower runs first). Default: 0.
hookstableEmpty table; derived modules list hook names they want to receive.

Usage Pattern

All concrete flowgraph modules use _flowgraph_createModule(C) which calls M.use() internally:

-- Defining a custom module (e.g., modules/myModule.lua)
local C = {}
C.moduleOrder = 100

function C:init()
  self:clear()
end

function C:clear()
  self.myState = {}
end

function C:onUpdate(dtReal, dtSim, dtRaw)
  -- per-frame logic
end

function C:executionStopped()
  self:clear()
end

return _flowgraph_createModule(C)

Factory Internals

-- createBase: raw construction
function M.createBase(...)
  local o = {}
  setmetatable(o, C)
  C.__index = C
  o:init(...)
  return o
end

-- use: construction + derived class mixin
function M.use(mgr, derivedClass)
  local o = M.createBase(mgr)
  local baseInit = o.init
  for k, v in pairs(derivedClass) do
    o[k] = v  -- overlay derived methods/properties
  end
  if o.init ~= baseInit then
    o:init()  -- call derived init if overridden
  end
  return o
end

See Also

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

Vehicle Editor - Static Render View

Manages multiple independent render views for the static vehicle editor, with 3D/orthographic modes, axis gizmo navigation, grid overlays, and WASD camera control.

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

On this page

Public FunctionsBase Class (C) MethodsBase Class PropertiesUsage PatternFactory InternalsSee Also