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

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 Extensionsgameplay

Gameplay Rally

Main extension for the rally gameplay system. Manages rally mission loading/unloading, co-driver timing, recce app, rally toolbox debug UI, and integration with race pathnode events.

Main extension for the rally gameplay system. Manages rally mission loading/unloading, co-driver timing, recce app, rally toolbox debug UI, and integration with race pathnode events.


Public API

FunctionSignatureReturnsDescription
M.loadMission(missionId, missionDir, drivelineMode)nilLoads a rally mission from the given directory
M.unloadMission()nilUnloads the current rally mission
M.isReady()boolReturns true if a rally manager is loaded
M.getRallyManager()RallyManager/nilReturns the active rally manager
M.getErrorMsgForUser()string/nilReturns any user-facing error message
M.enableRecceApp(val)nilEnables/disables the recce app
M.toggleDebug()nilToggles the Rally Toolbox imgui debug window
M.getRallyToolbox()RallyToolbox/nilReturns the toolbox instance
M.isRallyToolboxVisible()boolWhether the debug toolbox is visible
M.getRace()table/nilReturns the registered race data
M.getDebugLogging()boolReturns debug logging state
M.setDebugLogging(val)nilEnables/disables debug logging

Input Actions

ActionDescription
M.actionToggleMouseLikeVehicleToggles mouse-as-vehicle for recce debugging
M.actionTranscribeRecordingCutTriggers cut recording in recce mode
M.actionRecceMoveVehicleForwardMoves recce vehicle forward
M.actionRecceMoveVehicleBackwardMoves recce vehicle backward
M.actionCodriverCallsEarlierDecreases co-driver timing by 0.1s
M.actionCodriverCallsLaterIncreases co-driver timing by 0.1s

Hooks

HookPurpose
M.onUpdateUpdates recce app, rally manager, and debug toolbox
M.onVehicleResettedForwards vehicle reset to rally manager
M.onExtensionLoadedLoads helper extensions, triggers UI event
M.onExtensionUnloadedUnloads helper extensions
M.onRacePathnodeReachedRecords split times in rally manager
M.onRallyRegisterRaceStores race data and passes to rally manager
M.recceAppvalue

Dependencies (requires)

  • gameplay/rally/util
  • gameplay/rally/rallyManager
  • gameplay/rally/recceApp
  • gameplay/rally/tools/rallyToolbox
  • gameplay/rally/extHelper

How It Works

  1. loadMission() creates a RallyManager for the specified mission directory and validates it via reload()
  2. On each frame, onUpdate() ticks the recce app (if active) and the rally manager (if loaded and not recording)
  3. Co-driver timing is controlled via the rallyCodriverTiming setting (1.0–10.0 seconds), adjustable with input actions
  4. onRacePathnodeReached forwards pathnode events to the rally manager for split recording
  5. The Rally Toolbox provides an imgui debug window (hidden when the menu or editor is active)
  6. Input actions are bound to controller/keyboard for recce operations and co-driver timing

Usage Examples

-- Load a rally mission
extensions.load("gameplay_rally")
gameplay_rally.loadMission("myStage", "/levels/west_coast/rally/stage1/")

-- Check readiness
if gameplay_rally.isReady() then
  local mgr = gameplay_rally.getRallyManager()
end

-- Adjust co-driver timing
settings.setValue('rallyCodriverTiming', 4.0)

-- Toggle debug toolbox
gameplay_rally.toggleDebug()

Notes

  • Co-driver timing range: 1.0–10.0s, stored in rallyCodriverTiming setting
  • The recce app and rally manager are mutually exclusive in onUpdate (recce recording suppresses rally manager updates)
  • Many race/rally lifecycle hooks are defined but commented out, ready for future use
  • The rally toolbox only renders when menu and editor are inactive

See Also

  • Gameplay Achievement - Related reference
  • Gameplay City - Related reference
  • discover - Discover / Experience System - Related reference
  • Gameplay Systems Guide - Guide

Gameplay Police

Manages police pursuit logic including suspect tracking, arrest/evade timers, roadblock placement, and pursuit mode escalation. Tightly integrated with the traffic system.

Gameplay Rally Loop

Extension (`gameplay_rallyLoop`) that manages rally loop gameplay - a looping multi-stage rally system. Wraps a `RallyLoopManager` and handles lifecycle, UI streaming, debug toolbox, and mission trans

On this page

Public APIInput ActionsHooksDependencies (requires)How It WorksUsage ExamplesNotesSee Also