API ReferenceGE ExtensionseditorvehicleEditorliveEditor
Vehicle Editor - TCS Debug
Real-time Traction Control System (TCS) debugging tool that plots per-wheel brake factors, slip values, throttle factors, and slip thresholds as scrolling multi-line graphs.
Real-time Traction Control System (TCS) debugging tool that plots per-wheel brake factors, slip values, throttle factors, and slip thresholds as scrolling multi-line graphs.
Module Exports
| Export | Type | Description |
|---|---|---|
M.menuEntry | string | "TCS" - menu label |
M.open | function | Opens the TCS debug window |
M.onUpdate | hook | Queries TCS data and renders graphs |
M.onExtensionLoaded | hook | Initializes slip threshold buffer |
M.onExtensionUnloaded | hook | Cleanup (empty) |
M.onSerialize | hook | Persists window state |
M.onDeserialized | hook | Restores window state |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
windowOpen | BoolPtr | Window visibility |
dataPointCount | number | 600 data points per graph (scrolling buffer) |
brakeFactors | table | Per-wheel brake factor history |
wheelSlips | table | Per-wheel slip history |
throttleFactors | table | Per-engine throttle factor history |
allWheelSlips | table | Per-wheel total slip history |
slipThresholds | table | Slip threshold history |
How It Works
- Queries vehicle-side ESC controller debug data via
queueLuaCommand - On first data reception, initializes per-wheel buffers (600 entries each)
- Each frame, shifts oldest value out and appends newest
- Renders three stacked
PlotMultiLinesgraphs:- Graph 1: Wheel brake factors (range -0.25 to 1)
- Graph 2: Wheel slips + slip threshold (range 0 to 0.5)
- Graph 3: Throttle factors + all wheel slips (range 0 to 1)
Each graph auto-sizes to fill 1/3 of available window height.
Lua Code Example
-- Open TCS debug
extensions.editor_vehicleEditor_liveEditor_veTCSDebug.open()
-- Vehicle-side query for ESC controller data:
-- vEditor.vehicle:queueLuaCommand([[
-- local escControllers = controller.getControllersByType("esc")
-- local tcsData = (#escControllers >= 1) and escControllers[1].debugData.tcs or nil
-- obj:queueGameEngineLua("vEditor.tcsData = " .. serialize(tcsData))
-- ]])
-- TCS data structure from vehicle side:
-- vEditor.tcsData = {
-- wheelBrakeFactors = { FL = 0.0, FR = 0.0, ... },
-- wheelSlips = { FL = 0.1, FR = 0.05, ... },
-- throttleFactors = { mainEngine = 0.8, ... },
-- allWheelSlips = { FL = 0.12, FR = 0.06, ... },
-- slipThreshold = 0.15,
-- }
-- Scrolling buffer pattern:
-- table.remove(brakeFactors[k], 1) -- remove oldest
-- table.insert(brakeFactors[k], v) -- add newest
-- Multi-line graph rendering uses color-coded per-wheel lines:
-- colors1 = {{52,177,255,255}, {167,255,0,255}, {255,0,120,255}, {255,119,0,255}}
-- im.PlotMultiLines("", #tables, names, colors, tables, 600, "", min, max, size)
-- Graph sizes adapt to window:
-- local height = (windowSize.y - 140) / 3
-- local width = windowSize.x - paddingSee Also
- Adjustable Tech Car Tuner - Related reference
- Aero Debug - Related reference
- Crash Tester - Related reference
- World Editor Guide - Guide
Vehicle Editor - Raw Vehicle Data
Displays the complete raw vehicle data (`vEditor.vehData`) as a recursive tree in the Vehicle Editor.
Vehicle Editor - Vehicle Spawner
Tool for spawning and despawning multiple vehicles at specified positions within the Vehicle Editor, with interactive location picking via raycast.