RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Campaign SystemCampaign LoaderCampaign ComicsCampaign DealerCampaign ExplorationCampaign Photo SafariCampaign Rewards

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 Extensionscampaign

Campaign Exploration

Free-roam exploration mode between campaign scenarios. Manages trigger zones, location markers, road navigation, minimap UI, vehicle spawning, and transitions between exploration and scenarios.

Free-roam exploration mode between campaign scenarios. Manages trigger zones, location markers, road navigation, minimap UI, vehicle spawning, and transitions between exploration and scenarios.


Dependencies

M.dependencies = {'campaign_campaigns'}

Overview

Depends on campaign_campaigns. Provides the "overworld" between campaign missions - the player drives freely, encounters location triggers, views mission info, accepts scenarios, and navigates via ground markers. Handles subsection prefab spawning, site/scenario/transition triggers, and minimap display.


Public API

FunctionArgsReturnsDescription
M.startSubsectionExplorationsubsectionKey, locationMarker, spawningData-Starts exploration in a campaign subsection
M.endSubsectionExploration--Cleans up exploration (prefabs, vehicles, markers, UI)
M.stop--Stops exploration mode and cleans up UI
M.getExplorationActive-booleanWhether exploration is currently active
M.isValidSubsectioncampaign, subsectionNamebooleanChecks if subsection exists in campaign
M.isValidLocationcampaign, subsectionName, locationKeybooleanChecks if location exists in subsection
M.accept--UI callback: show mission details or trigger acceptance
M.decline--UI callback: decline mission and show short info
M.setFocusPOIpoi-Sets focused point of interest with ground marker navigation
M.onFocusPOIpoi-UI callback: focus a POI from map view
M.buildRoadIndicator--Builds road navigation path to focused POI
M.queryRoadNodeToPositionvehicle, position, owner-Finds closest road node to a position
M.toggleMinimap--Toggles minimap UI (pauses/resumes sim time)
M.updateMapUI--Sends full minimap data to UI
M.refreshLocationMarkerssubsection-Creates/refreshes 3D markers for locations
M.startTimeTrailscenarioFile, trackFile, vehicleFile-Starts a quick race time trial from exploration
M.uiEventSelectVehiclevehicleData-Handles vehicle selection from garage/dealer UI
M.uiEventGarageExit--Handles garage UI exit
M.onBeamNGTriggerdata-Processes trigger enter/exit events
M.onUpdate--Per-frame: loads next scenario when flagged
M.onPreRenderdt-Per-frame: road queries, marker updates, vehicle spawning
M.onVehicleSpawnedvehicleId-Tracks recently spawned vehicles
M.onClientStartMissionlevelPath-Processes pending exploration after level load
M.onClientEndMissionlevelPath-Cleans up exploration on mission end
M.onUiChangedStatecurUIState, prevUIState-Handles UI state transitions during exploration
M.onCameraToggleddata-Handles FreeCam/GameCam transitions
M.onSerialize-tableSerializes exploration state
M.onDeserializeddata-Restores exploration state
M.onSaveCampaignsaveCallback-Provides state for campaign save
M.onResumeCampaigncampaignInProgress, data-Restores state from save
M.onUILayoutLoadedlayoutType-Shows map hint when exploration layout loads

Internal State

FieldTypeDescription

Trigger Flow

Player enters trigger zone → onBeamNGTrigger
  → Site location?  → handleSiteTrigger (transition/missionGiver/HQ/vendor)
  → Scenario?       → handleScenarioTrigger → openShortLocationInfo → accept()
  → Ramp trigger?   → Save checkpoint position

Player exits trigger → Clear trigger state, close dialogue

Input Filtering

Blacklisted actions during exploration:

{"switch_next_vehicle", "switch_previous_vehicle", "loadHome", "saveHome",
 "reload_vehicle", "reload_all_vehicles", "vehicle_selector", "parts_selector",
 "dropPlayerAtCamera", "toggleWalkingMode", "toggleTraffic", "toggleAITraffic"}

Location Marker System

-- 3D markers are TSStatic checkpoint models
-- Colors indicate state:
--   White  = available scenario (can improve)
--   Yellow = available site
--   Green  = focused/selected POI

Minimap Data

The minimap provides:

  • POI positions normalized to map coordinates
  • Player position and heading
  • Location states (ready/completed/medal)
  • Mission log entries (photo safari)

Notes

  • Level transitions are handled asynchronously - spawning data is stored in pendingSpawningData
  • Ramp triggers save checkpoint positions for jump recovery
  • Exploration uses core_gamestate.setGameState('exploration', ...) in shipping builds
  • Vehicle freezing (controller.setFreeze) is used during UI interactions
  • The race_marker module provides destination markers with nav paths
  • Collision is reloaded when transitioning from a scenario

See Also

  • Campaign System - Campaign orchestration
  • Campaign Loader - Campaign file and save management
  • Campaign Photo Safari - Photo mode missions in exploration

Additional Exports

  • M.recentlySpawnedVehicle - (undocumented)
  • M.state - (undocumented)

Campaign Dealer

Vehicle and item stock management for campaign dealer/vendor locations. Tracks purchasable inventory with add/remove/buy operations and campaign save/resume support.

Campaign Photo Safari

Photo safari mission system for campaign exploration. Players drive to locations, enter photo mode, and capture specific objects within camera constraints.

On this page

DependenciesOverviewPublic APIInternal StateTrigger FlowInput FilteringLocation Marker SystemMinimap DataNotesSee AlsoAdditional Exports