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
Bus Mode MissionsTime Trial Missions

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 ExtensionsgameplaymissionsproceduralMissionGenerators

Bus Mode Missions

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

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


Module Exports (M)

FunctionSignatureDescription
generate() → tableGenerates bus mode mission data from scenario bus route files

How It Works

local function generate()
  -- 1. Get all levels with bus scenarios
  local data = scenario_scenariosLoader.getLevels('bus')

  for _, level in ipairs(data) do
    -- 2. Load all .buslines.json files for the level
    local busLineFiles = FS:findFiles('/levels/'..level.levelName..'/buslines/', '*.buslines.json')

    -- 3. Index routes by composite key: routeID + variance
    for _, route in pairs(busLine.routes) do
      routeData[route.routeID .. route.variance] = route
    end

    -- 4. For each scenario, build a mission from route data
    for _, scenario in ipairs(level.scenarios) do
      local mission = getBaseMission()
      mission.id = levelName..'-'..routeID.."-"..variance.."-procedural"
      mission.missionType = "busMode"

      -- 5. Set missionTypeData with route details
      mission.missionTypeData = {
        routeId = route.routeID,
        variance = route.variance,
        tasklist = route.tasklist,
        navhelp = route.navhelp,
        model = route.vehicle.model,
        config = route.vehicle.config,
        -- Reversed route for continuation
        rtasklist = reverseRoute.tasklist,
        rnavhelp = reverseRoute.navhelp,
      }

      -- 6. Set start trigger from bus spawn location
      mission.startTrigger.pos = vec3(route.spawnLocation.pos)
      mission.startTrigger.rot = quat(route.spawnLocation.rot)
    end
  end
  return missions
end

Generated Mission Structure

FieldValue
missionType"busMode"
retryBehaviour"infiniteRetries"
careerSetup.defaultStarKeys{'justFinish', 'noAccident'}
careerSetup.showInCareerfalse
careerSetup.showInFreeroamtrue
descriptionLocalized with bus stop count context
thumbnailFile/gameplay/missionTypes/busMode/thumbnail.jpg
M.generate()

Key Behaviors

  • Routes are identified by composite key routeID + variance (e.g., "route1a", "route1b")
  • Reverse route (opposite variance) is included for mission continuation
  • Spawn rotation handles both rotAngAxisF and quat formats
  • missionStartTriggerPos can override the start position separately from the vehicle spawn
  • The generator only runs for levels that have bus route data files
  • Generated missions are marked as procedural and get sanitized by the mission system

See Also

  • proceduralMissionGenerators/timeTrialMissions - Time Trial Mission Generator - Related reference
  • Gameplay Systems Guide - Guide

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

Time Trial Missions

Reference for the time trial procedural mission generator that converts quickrace tracks into playable time trial missions.

On this page

Module Exports (M)How It WorksGenerated Mission StructureKey BehaviorsSee Also