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
Drag Race DebugDrag Tree DisplayDrag Race APIDrag Racing ManagerDrag Strip Save SystemDrag Race TimingDrag Race Phases

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 Extensionsgameplaydrag

Drag Race API

Reference for `gameplay_drag_dragBridge`, which provides a stable public API over the internal drag race subsystem. Used by flowgraph nodes, missions, and UI screens.

Reference for gameplay_drag_dragBridge, which provides a stable public API over the internal drag race subsystem. Used by flowgraph nodes, missions, and UI screens.


Overview

Thin facade that delegates to gameplay_drag_general, gameplay_drag_saveSystem, and gameplay_drag_utils. Provides load/start/stop/query functions without exposing internal state management. Also includes opponent generation and vehicle permission checking utilities for career / mission use.


Exports

FunctionSignatureDescription
loadDragStrip(dragStripId) → table|nilLoad strip data (new modular → legacy fallback)
configureDragStrip(dragStrip) → boolCompatibility stub - returns true if non-nil
startDragRace(vehicleId, lane) → boolStart a race for a vehicle in a lane
stopDragRace() → trueClears all drag data
resetDragRace() → boolResets current race without clearing data
getDragRaceData() → table|nilActive playable racer snapshot
getDragRaceRuntimeData() → table|nilExtended runtime data (pos, speed, damage)
getDragStripInfo(dragStripId?) → table|nilStrip metadata (name, lanes, phases, prefabs)
isDragRaceActive() → boolWhether a race is currently started
getActiveRacerId() → number|nilVehicle ID of the playable racer
getAllDragStrips() → tableAll strip data from save system
getPlayerDragTimes(vehicleId) → tableSaved times for a vehicle
savePlayerDragTimes(vehicleId, times)Persist times
generateOpponentsGroup(vehId, dial, rules, amount, offset) → tablePick random opponents by quarter-mile time
setupRacer(vehicleId, lane)Direct racer setup passthrough
setVehicles(vehicleIds)Batch-set racers with lane, playable, dial
getTimers(vehicleId) → tableTimer data for a racer
getData() → tableRaw drag data
getRacerData(vehicleId) → tableRacer entry
loadDragDataForMission(filepath)Full mission load: clear → load → prefabs → extensions
startDragRaceActivity(lane) → boolStart via general
clearRacers()Remove all racers
setRacerDial(vehicleId, dialValue)Set single racer dial
setRacersDial(dials)Batch set dials
unloadRace()Full clear
getDialTimes() → tableSaved dial times
generateHashFromFile(vehicleId?) → stringConfig hash for dial lookup
getDragIsStarted() → boolRace started flag
getWinnersData() → tableWinner list from utils
createTimeslipData() → tableTimeslip for UI
sendTimeslipDataToUi()Push timeslip to UI
screenshotTimeslip()Take timeslip screenshot
clearTimeslip()Clear timeslip UI
getHistory(id) → tableRace history
openHistoryScreen(facility)Open drag history UI with tether
onMenuClosed()Remove tether
closeMenu()Close all career menus
cleanup()Stop race if active

Opponent Generation

local opponents = gameplay_drag_dragBridge.generateOpponentsGroup(
  vehId,           -- reference vehicle
  dialTime,        -- target 1/4 mile time (nil = auto from vehicle data)
  permissionRules, -- array of {path, allowedValues/value}
  2,               -- amount of opponents
  0.5              -- time offset window (±)
)
-- Returns: {{model, config, paint}, ...}

Vehicle permission rules filter by nested property paths:

local rules = {
  {path = {"Type"}, allowedValues = {"Car", "Truck"}},
  {path = {"Derby Class"}, value = "A"}
}

Key Behaviors

  • loadDragDataForMission performs a complete lifecycle: clear → load strip → load prefabs → set context → set data → configure drag type extension
  • Opponent selection uses core_vehicles.getConfigList() filtered by quarter-mile time within [dial - offset, dial + 0.1]
  • openHistoryScreen creates a sphere tether in career mode that auto-closes the menu if the player walks away

Additional Exports

FunctionSignatureDescription
getHistory(id) → tableReturns race history for a drag strip
openHistoryScreen(facility)Opens drag history UI screen with tether
onMenuClosed()Removes tether on menu close
closeMenu()Closes all career menus
cleanup()Stops active race and clears state
getWinnersData() → tableReturns winner data from utils
generateHashFromFile(vehicleId?) → stringGenerates config hash for dial time lookup
getDialTimes() → tableReturns saved dial times
M.cleanup()-
M.clearRacers()-
M.clearTimeslip()-
M.closeMenu()-
M.configureDragStrip(dragStrip)-
M.createTimeslipData()-
M.generateHashFromFile(vehicleId)-
M.generateOpponentsGroup(vehId, dial, vehiclePermissionRules, amount, offset)-
M.getActiveRacerId()-
M.getAllDragStrips()-
M.getData()-
M.getDialTimes()-
M.getDragIsStarted()-
M.getDragRaceData()-
M.getDragRaceRuntimeData()-
M.getDragStripInfo(dragStripId)-
M.getHistory(id)-
M.getPlayerDragTimes(vehicleId)-
M.getRacerData(vehicleId)-
M.getTimers(vehicleId)-
M.getWinnersData()-
M.isDragRaceActive()-
M.loadDragDataForMission(filepath)-
M.loadDragStrip(dragStripId)-
M.onMenuClosed()-
M.openHistoryScreen(facility)-
M.resetDragRace()-
M.savePlayerDragTimes(vehicleId, times)-
M.screenshotTimeslip()-
M.sendTimeslipDataToUi()-
M.setRacerDial(vehicleId, dialValue)-
M.setRacersDial(dials)-
M.setVehicles(vehicleIds)-
M.setupRacer(vehicleId, lane)-
M.startDragRace(vehicleId, lane)-
M.startDragRaceActivity(lane)-
M.stopDragRace()-
M.unloadRace()-

See Also

  • drag/debug - Drag Race Debug Menu - Related reference
  • drag/display - Christmas Tree & Display Signs - Related reference
  • drag/general - Core Drag Race Manager - Related reference
  • Gameplay Systems Guide - Guide

Drag Tree Display

Reference for `gameplay_drag_display`, which controls the visual Christmas tree lights and digital display signs on the drag strip, plus corresponding UI updates.

Drag Racing Manager

Reference for `gameplay_drag_general`, which is the central state manager for the entire drag racing subsystem. Owns `dragData`, manages extension loading/unloading, racer setup, race lifecycle, times

On this page

OverviewExportsOpponent GenerationKey BehaviorsAdditional ExportsSee Also