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
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker

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 Extensionsgameplayrally

Rally Manager

Central runtime manager for a rally stage. Coordinates the notebook, driveline route, audio manager, vehicle tracker, and pacenote queue during gameplay.

Central runtime manager for a rally stage. Coordinates the notebook, driveline route, audio manager, vehicle tracker, and pacenote queue during gameplay.


Constructor

local RallyManager = require('/lua/ge/extensions/gameplay/rally/rallyManager')
local rm = RallyManager(missionDir, missionId)

Public API

FunctionSignatureReturnsDescription
C:reload()booleanFull reload: loads race path, notebook, driveline, audio manager
C:softReload()booleanClears visual pacenotes, resets audio queue, triggers driveline recalc
C:onUpdate(dtReal, dtSim, dtRaw)nilPer-frame update for vehicle tracker, driveline, audio, and queue
C:onVehicleResetted()nilHandles vehicle reset (calls softReload)
C:triggerPacenote(pacenote)nilSends pacenote to audio manager and/or visual HUD
C:enqueuePacenote(pacenote)nilAdds pacenote to the processing queue
C:enqueueHold()nilAdds a HOLD marker to pause queue processing
C:clearQueueHold()nilRemoves HOLD from queue front if present
C:enqueueRandomSystemPacenote(name)nilQueues a random system pacenote (e.g., "finish")
C:enqueuePauseSecs(secs)nilQueues a timed pause in audio playback
C:playFirstPacenote()nilPlays the first pacenote in the notebook
C:getNextPacenotes()tableReturns array with next pacenote from driveline route
C:closestPacenoteToVehicle()pacenoteFinds nearest pacenote to vehicle position
C:drawPacenotesForDriving()nilDebug draws next pacenote text at corner start
M.getErrorMsgForUser()nilgetErrorMsgForUser
M.getPacenoteProcessingEnabled()nilgetPacenoteProcessingEnabled
M.setPacenoteProcessingEnabled(enabled)nilsetPacenoteProcessingEnabled
M.getMissionStartTrigger()nilgetMissionStartTrigger
M.setupDrivelineRouteHooks()nilsetupDrivelineRouteHooks
M.codriver()nilcodriver
M.getPointDistanceFromStartMeters(point)nilgetPointDistanceFromStartMeters
M.getPointDistanceFromStartKm(point)nilgetPointDistanceFromStartKm
M.getTimeAllocationString()nilgetTimeAllocationString
M.getSplitDataIndex()nilgetSplitDataIndex
M.triggerShowVisualPacenote(pacenote)niltriggerShowVisualPacenote
M.triggerClearVisualPacenote(pacenote)niltriggerClearVisualPacenote
M.triggerClearAllVisualPacenotes()niltriggerClearAllVisualPacenotes
M.sendPacenoteToAudioManager(pacenote)nilsendPacenoteToAudioManager
M.resetAudioQueue()nilresetAudioQueue
M.getStartAndFinishStartPositions()nilgetStartAndFinishStartPositions
M.recordSplit(pathnodeId, time)nilrecordSplit
M.getLoopPrefabPath()nilgetLoopPrefabPath

Mission & Race Data

FunctionSignatureReturnsDescription
C:getMissionId()stringMission identifier
C:getMissionDir()stringMission folder path
C:getMissionName()stringTranslated mission name
C:getNotebookPath()notebookCurrent notebook object
C:getRacePath()pathRace path object
C:getRaceData()tableRace timing data
C:setRaceData(raceData)nilSets race timing data
C:getDrivelineRoute()DrivelineRouteDriveline route object
C:getSpeedLimitKph()numberSpeed limit from DrivelineV3
C:getRaceDistanceMeters()numberTotal race distance
C:getRaceCompletionData()tableDistance and percentage completion
C:getActiveStageData()tableLive stage dashboard data
C:getTimeAllocationSecs()numberAllocated time based on distance and speed limit
C:hasAnyPacenotes()booleanWhether notebook has pacenotes

Start Positions

FunctionSignatureReturnsDescription
C:getStartPositionByName(name)startPosLookup by name
C:getTCInPos()startPosTime control in position
C:getTCOutPos()startPosTime control out position
C:getSSStartLinePos()startPosSpecial stage start line
C:getSSStopControlPos()startPosSpecial stage stop control
C:getSplitDataList()tableSplit timing data list

How It Works

Reload Flow

  1. Loads MissionSettings from mission directory
  2. Creates VehicleTracker with damage threshold
  3. Loads race path from race.json
  4. Loads notebook and caches compiled pacenotes
  5. Creates AudioManager
  6. Creates DrivelineRoute and sets up hook callbacks
  7. Loads driveline via DrivelineV3 (recorded driveline file)
  8. Calls softReload() to initialize route state

Pacenote Queue (Dequeue)

  • Pacenotes are enqueued by driveline route hit callbacks
  • HOLD values pause queue processing (used for slow corners)
  • processPacenoteQueue() runs each frame, popping and triggering pacenotes
  • Queue cleared on vehicle reset or soft reload

Driveline Route Hooks

The rally manager registers callbacks on the driveline route for various trigger points:

  • onPacenoteCsDynamicHit - Dynamic corner start trigger
  • onPacenoteCsImmediateHit - Immediate corner start
  • onPacenoteCsStaticHit - Static corner start (also clears visual)
  • onPacenoteCeStaticHit - Static corner end
  • onPacenoteCsOffsetHit / onPacenoteCeOffsetHit - Offset triggers (e.g., -5m)
  • onPacenoteCornerPercentHit - Percentage-based triggers (e.g., 50%)
-- Typical usage in a mission extension
local rm = RallyManager(missionDir, missionId)
if rm:reload() then
  -- In update loop:
  rm:onUpdate(dtReal, dtSim, dtRaw)
end

See Also

  • Rally Audio Manager - Related reference
  • Rally Camera Path Player - Related reference
  • Rally Client - Related reference
  • Gameplay Systems Guide - Guide

Rally Geometry

Early work-in-progress rally co-driver system. Generates pacenotes from a route by analyzing road geometry - computing turn radius, velocity, severity, and direction for each node, then splitting and

Recce Manager

High-level manager for rally recce (reconnaissance) recordings. Coordinates loading driveline recordings and voice cut markers, then converts them into pacenote data for the notebook.

On this page

ConstructorPublic APIMission & Race DataStart PositionsHow It WorksReload FlowPacenote Queue (Dequeue)Driveline Route HooksSee Also