RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Drag Race Editor ConstantsDrag Race Editor - Drag SettingsDrag Race Editor - FacilitiesDrag Race Editor - LanesDrag Race Editor - StateDrag Race Editor - StripsDrag Race Editor - UtilsDrag Race Editor - Waypoints

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 ExtensionseditordragRaceEditor

Drag Race Editor - Utils

Utility functions for the drag race editor: error display, undo/redo stack, data validation, lane creation, mouse info tracking, and transform setup.

Utility functions for the drag race editor: error display, undo/redo stack, data validation, lane creation, mouse info tracking, and transform setup.


Public API

FunctionSignatureDescription
M.logError(message)Sets error state and logs error
M.showError()Displays timed error text in ImGui
M.markUnsavedChanges()Sets unsaved changes flag in state
M.clearUnsavedChanges()Clears unsaved changes flag
M.saveToUndoStack()Deep copies current data to undo stack, clears redo
M.undo()Pops undo stack, pushes current to redo
M.redo()Pops redo stack, pushes current to undo
M.validateDragRaceData(data) → bool, stringValidates drag race data format and required fields
M.createNewLane(laneIndex) → tableCreates default lane with stage + endLine waypoints and boundary
M.createNewDragRaceData() → tableCreates blank drag race config with phases and prefabs
M.reorderLanes(t, old, new)Moves element in array from old to new index
M.updateMouseInfo()Updates mouse raycasting info (position, click, hold, release)
M.setupTransform(label, transform, allowT, allowR, allowS) → transformUtilCreates a transformUtil instance from position/rotation/scale table

Validation

local valid, err = utils.validateDragRaceData(data)
-- Supports both modular format (facilityId + stripId) and legacy format (strip.lanes)
-- Returns false with reason string if invalid

Mouse Info Structure

-- After updateMouseInfo():
mouseInfo = {
  camPos = vec3,       -- camera position
  ray = ray,           -- camera mouse ray
  rayDir = vec3,       -- ray direction
  rayCast = result,    -- raycast hit result
  valid = bool,        -- whether raycast hit
  down = bool,         -- mouse just clicked (LMB, not over ImGui)
  hold = bool,         -- mouse held
  up = bool,           -- mouse just released
  _downPos = vec3,     -- world position at click
  _holdPos = vec3,     -- world position while held
  _upPos = vec3,       -- world position at release
}

Default Drag Race Data

local data = utils.createNewDragRaceData()
-- data.dragType = "headsUpRace"
-- data.phases = { {name="stage"}, {name="countdown"}, {name="race"}, {name="stop"} }
-- data.prefabs = { christmasTree, displaySign, paths, decorations }

Dependencies

ModulePurpose
editor/dragRaceEditor/constantsDefault transform, error colors
editor/dragRaceEditor/stateShared state (undo/redo stacks, mouse info, drag data)
editor/util/transformUtilTransform editing utility
ui_imguiImGui for error display

See Also

  • Drag Race Editor Constants - Related reference
  • Drag Race Editor - Drag Settings - Related reference
  • Drag Race Editor - Facilities - Related reference
  • World Editor Guide - Guide

Drag Race Editor - Strips

Manages drag racing strip data: loading, selecting, adding, removing, saving, and editing strips with lanes, waypoints, and boundaries. Provides ImGui UI for strip/lane/waypoint/boundary selection and

Drag Race Editor - Waypoints

Manages standalone drag race waypoint data: loading, selecting, adding (spawn/stage/endLine), removing, saving, and ImGui UI for waypoint editing with transform gizmos and world-space preview.

On this page

Public APIValidationMouse Info StructureDefault Drag Race DataDependenciesSee Also