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
Flowgraph Action ModuleFlowgraph AI Recording ModuleFlowgraph Button ModuleFlowgraph Camera ModuleFlowgraph Drift ModuleFlowgraph File ModuleFlowgraph Foreach ModuleFlowgraph Level ModuleFlowgraph Mission ModuleMission Replay ModulePrefab ModuleThread ModuleTimer ModuleTraffic ModuleUI ModuleVehicle Module

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 Extensionsflowgraphmodules

Flowgraph Button Module

Manages custom UI buttons displayed during flowgraph execution. Nodes can create, configure, and respond to button clicks through this module. Button state is sent to the UI via `guihooks.trigger('Cus

Manages custom UI buttons displayed during flowgraph execution. Nodes can create, configure, and respond to button clicks through this module. Button state is sent to the UI via guihooks.trigger('CustomFGButtons', data).

No public module exports - created via _flowgraph_createModule(C).


Purpose

Provides a button registry for flowgraph nodes. Each button has a label, style, active state, order, and click tracking. The module uses variableStorage for reactive state management and pushes button data to the UI layer each frame.


Key Methods

MethodSignatureDescription
init()Creates variable storage, calls clear().
clear()Clears all buttons and variables, triggers empty button list to UI.
addButton(data)Creates a button with label, style, active, and order. Returns button ID. Registers 6 variables per button (label, style, active, order, clicked, complete).
getButton(id)Returns the button table for the given ID.
set(id, field, val)Updates a button field (label, style, active, order) via variable storage.
buttonClicked(id)Marks a button as clicked and complete. Called from UI via queueGameEngineLua.
getCmd(id)Returns the Lua command string the UI calls when a button is clicked.
afterTrigger()Finalizes variable changes, sends sorted active buttons to UI via guihooks, resets click flags.
executionStopped()Calls clear() to remove all buttons.

Button Data Structure

-- Internal button table (per button):
{
  id = 1,
  label    = variableRef,  -- { value = "Go!" }
  style    = variableRef,  -- { value = "default" }
  active   = variableRef,  -- { value = true }
  order    = variableRef,  -- { value = 1 }
  clicked  = variableRef,  -- { value = false }
  complete = variableRef,  -- { value = false }
}

UI Communication

-- Buttons are pushed to the UI each frame:
guihooks.trigger('CustomFGButtons', {
  { name = "Start", fun = "local m = core_flowgraphManager.getManagerModule(1, 'button') if m then m:buttonClicked(1) end",
    active = true, order = 1, style = "default" },
  { name = "Stop",  fun = "...", active = true, order = 2, style = "danger" },
})

-- Buttons sorted by order, then by ID

Properties

PropertyDefaultDescription
moduleOrder0Standard priority.
variablesVariableStorageReactive state for button properties.
buttons{}Registry of button objects keyed by ID.
buttonsChangedtrueDirty flag to re-send button data to UI.

Additional Exports

getFreeId()

  • Returns: any

  • idCounter - number - (see source)


See Also

  • Flowgraph Action Module - Related reference
  • Flowgraph AI Recording Module - Related reference
  • Flowgraph Camera Module - Related reference
  • FlowGraph Guide - Guide

Flowgraph AI Recording Module

Handles recording and replaying AI vehicle scripts during mission execution. Used for mission testing - records the player's driving as an AI path, then saves it alongside mission test data.

Flowgraph Camera Module

Manages camera path playback for flowgraph projects. Loads, stores, plays, and cancels camera paths. Used for cinematic sequences, mission intros, and scripted camera movements.

On this page

PurposeKey MethodsButton Data StructureUI CommunicationPropertiesAdditional ExportsgetFreeId()See Also