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

UI Module

Flowgraph module that builds mission start/end screen UIs. Provides a builder pattern for composing screen layouts with elements (text panels, objectives, ratings, drift stats, lap times, crash analys

Flowgraph module that builds mission start/end screen UIs. Provides a builder pattern for composing screen layouts with elements (text panels, objectives, ratings, drift stats, lap times, crash analysis), buttons, and multi-page navigation. Manages game state backup/restore and app container contexts.


Module Properties

PropertyValueDescription
moduleOrder1000Late initialization order
hooksonRequestMissionScreenData, onMissionScreenButtonClicked, onGetIsMissionStartOrEndScreenActiveUI communication hooks
dependenciesui_gameplayAppContainersRequired extension

Class Methods

Lifecycle

MethodDescription
C:init()Calls clear()
C:clear()Resets isBuilding, uiLayout, appContainerContext
C:executionStarted()Saves game state and recovery prompt; disables recovery prompt; loads generic mission data and points bar extensions; clears tasklist
C:executionStopped()Clears mission data/points bar; resets app container context; restores recovery prompt and game state

Builder Pattern

MethodDescription
C:startUIBuilding(uiMode, node)Begins building a layout ("startScreen" or "endScreen"); stores source node reference
C:finishUIBuilding()Finalizes layout; adds start button for start screens; sets up pages; triggers state change to mission-control
C:addUIElement(element)Appends a layout element (must be building)
C:addHeader(header)Sets the screen header
C:addButton(fun, meta)Registers a button callback; returns button metadata with mgrId and funId
C:clearButtonFunctions()Clears all registered button callbacks
C:setupPages()Builds page tabs from layout elements' pages fields; configures order, icons, mandatory flags

Content Elements

MethodDescription
C:addObjectives(change)Adds star objectives panel with enabled/visible/reward state from active star cache
C:addRatings(change)Adds leaderboard ratings, rewards, and unlock panels
C:addDriftStats(driftStats)Adds performance stats, tier breakdown, and drift events tables
C:addLaptimesForVehicle(state, attempt)Adds lap times table with best-lap highlighting
C:addCrashAnalysisStepDetails(stepDetails)Adds crash test step score details
C:addReplayPanelAndSupportsReplay()Adds replay recording panel if mission supports replay

Configuration

MethodDescription
C:setStartButtonText(text)Overrides default start button label
C:setStartScreenAsSimple()Marks start screen as simple (disables replay panel)
C:setGameState(...)Forwards to core_gamestate.setGameState(...)
C:setAppContainerContext(context)Sets gameplay app container context
C:keepGameState(keep)If keep=true, game state will NOT be restored on stop

Hook Handlers

MethodDescription
C:onRequestMissionScreenData(mode)Sends layout data to UI via onRequestMissionScreenDataReady trigger
C:onMissionScreenButtonClicked(button)Executes button callback matching mgrId; clears layout
C:onGetIsMissionStartOrEndScreenActive(screensActive)Reports current screen mode to query

Usage Example

local uiMod = mgr.modules.ui

-- Build a start screen
uiMod:startUIBuilding("startScreen", self)
uiMod:addHeader({ title = "Race Challenge" })
uiMod:addObjectives()
uiMod:setStartButtonText("ui.missions.start.go")
uiMod:finishUIBuilding()

-- Build an end screen with ratings
uiMod:startUIBuilding("endScreen", self)
uiMod:addObjectives(change)
uiMod:addRatings(change)
uiMod:addLaptimesForVehicle(lapState, attempt)
uiMod:finishUIBuilding()

Internal Details

  • Page configuration defines 10 built-in pages (timeslip, main, rewards, unlocks, leaderboards, drift, lapTimes, rules, crashAnalysisStep, recording) with order/icon/mandatory
  • Button callbacks stored in buttonFunctions array; UI sends back mgrId + funId to invoke
  • Game state serialized at start and restored on stop (unless keepGameState called)
  • Recovery prompt state preserved and disabled during mission
  • formatMission local helper formats mission data for unlock display

Additional Exports

getFreeId()

  • Returns: any

nextPage()

  • idCounter - number - (see source)

See Also

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

Traffic Module

Flowgraph module wrapping `gameplay_traffic` and `gameplay_parking` APIs for flowgraph-managed traffic and parked car activation/deactivation. Automatically cleans up traffic and parking state when th

Vehicle Module

Flowgraph module that tracks all vehicles used by a flowgraph-spawned or foreign. Manages vehicle readiness, coupler attachments, bus systems, fuel storage, walk blacklist backup, and cleanup on flowg

On this page

Module PropertiesClass MethodsLifecycleBuilder PatternContent ElementsConfigurationHook HandlersUsage ExampleInternal DetailsAdditional ExportsgetFreeId()nextPage()See Also