RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Locations DetectorMission ManagerMissionsMission Screen UIPOI TestProgressMission Start TriggerUnlocks
Base MissionEditor HelperFlow Mission

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 ExtensionsgameplaymissionsmissionTypes

Flow Mission

Reference for the flowgraph mission type, the primary mission class used by most BeamNG missions. Extends `baseMission` with flowgraph manager integration, vehicle/traffic/environment setup modules, c

Reference for the flowgraph mission type, the primary mission class used by most BeamNG missions. Extends baseMission with flowgraph manager integration, vehicle/traffic/environment setup modules, career star/reward support, and custom script loading.


Module Export

Returns a constructor function (derivedClass, ...) that creates a flowMission instance inheriting from baseMission's C class. Accessible via gameplay_missions_missions.flowMission().


Class C - Key Methods

Lifecycle

MethodSignatureDescription
onStartC:onStart()Loads FG manager, sets variables, starts flowgraph, calls custom script
onUpdateC:onUpdate(dtReal, dtSim, dtRaw)Calls script onUpdate, applies wind to vehicles
onStopC:onStop(data)Stops FG manager, aggregates abandoned attempt, calls script onStop
attemptAbandonMissionC:attemptAbandonMission() → boolDelegates to FG's onRequestAbandon hook if available

Setup & Configuration

MethodSignatureDescription
getCommonSettingsDataC:getCommonSettingsData() → tableBuilds vehicle/traffic/environment user settings UI data
processCommonSettingsC:processCommonSettings(flatSettings)Applies user settings to setup modules
processUserSettingsC:processUserSettings(settings)Stores user settings for later use
setBackwardsCompatibilityC:setBackwardsCompatibility(keyAliases)Migrates old mission formats (vehicle modes, timeOfDay)
setPreviewsForCustomVehiclesC:setPreviewsForCustomVehicles(userSettings)Updates thumbnails for custom vehicle selections

Flowgraph Integration

MethodSignatureDescription
setupFlowgraphManagerC:setupFlowgraphManager(fgFile, variables)Loads FG project, sets mission/progress variables
addOrSetVariableC:addOrSetVariable(name, value) → errSets a flowgraph variable (bool/string/number/vec3/quat)
retrieveProgressFromFlowgraphC:retrieveProgressFromFlowgraph()Reads progress variables back from FG

Career

MethodSignatureDescription
getEntryFeeC:getEntryFee(userSettings) → table|nilReturns entry fee (attribute amounts)
getDynamicStarRewardC:getDynamicStarReward(key, userSettings)Override point for dynamic star rewards
getGameContextUiButtonsC:getGameContextUiButtons() → tableGathers UI buttons from FG nodes
getRulesC:getRules() → tableLoads HTML rule pages from mission layers
showRulesAsPopupsC:showRulesAsPopups()Displays rules as intro popups

Setup Modules

Missions configure these via setupModules:

Vehicles

  • enabled - whether vehicle setup is active
  • vehicles - array of {model, config, configPath, paintName}
  • includePlayerVehicle - allow player's own car
  • prioritizePlayerVehicle - default to player's car
  • User setting key: setupModuleVehicles

Traffic

  • enabled, useTraffic, usePrevTraffic, useSimpleVehs, useGameOptions
  • amount, activeAmount, parkedAmount, respawnRate
  • customGroupFile - vehicle group JSON
  • User setting key: setupModuleTraffic

Environment

  • enabled, time, timeScale, fogDensity, windSpeed, windDirAngle
  • todUserSetting - enable time-of-day user setting
  • User setting key: setupModuleEnvironmentTime

How It Works

-- Mission start flow:
function C:onStart()
  -- 1. Log issues for debugging
  -- 2. Call onPreStart() if defined
  -- 3. Merge fgVariables + oneOffVariables
  -- 4. Call preprocessMissionTypeData() if defined
  -- 5. setupFlowgraphManager(fgPath, variables)
  -- 6. Set progress variables from saved progress
  -- 7. Set user settings as FG variables
  -- 8. Start FG manager
  -- 9. Call script:onStart() if loaded
end

Key Behaviors

  • Custom scripts loaded from missionFolder/script.lua - instantiated with {mission = mission}
  • FG variables only set if they already exist in the flowgraph (no auto-creation)
  • ignoreUserSettingsKeyForActiveStars excludes certain settings from star eligibility checks
  • Backwards compatibility handles old mode vehicle setup, timeOfDay number format, and old branch names
  • onFlowgraphStateStarted/Stopped hooks forwarded to custom scripts
  • Vehicle hooks (onVehicleReset) forwarded via scriptHooks table

See Also

  • missionTypes/baseMission - Base Mission Type Constructor - Related reference
  • missionTypes/editorHelper - Mission Editor UI Element System - Related reference
  • Gameplay Systems Guide - Guide

Editor Helper

Reference for the editor helper class that provides a rich set of UI elements for editing mission type data in the mission editor. This is the backbone of all mission editor panels.

Bus Mode Missions

Reference for the bus mode procedural mission generator that creates missions from bus route data files.

On this page

Module ExportClass C - Key MethodsLifecycleSetup & ConfigurationFlowgraph IntegrationCareerSetup ModulesVehiclesTrafficEnvironmentHow It WorksKey BehaviorsSee Also