Race / Path Editor
Main editor tool for creating and editing race paths - manages pathnodes, segments, start positions, track layout, time trial metadata, and testing.
Main editor tool for creating and editing race paths - manages pathnodes, segments, start positions, track layout, time trial metadata, and testing.
Overview
A tabbed editor window with sub-modules for pathnodes, segments, start positions, track layout, time trials, and tools. Supports loading/saving .race.json files, AI route preview, race testing, and full undo/redo history.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.onEditorGui | () | Renders the main race editor window with menu bar and tabs |
M.onEditorInitialized | () | Registers raceEditMode, window, and loads all sub-module tabs |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers raceEditor.general preferences |
M.onSerialize | () | Saves current path and file info for session persistence |
M.onDeserialized | (data) | Restores path from serialized data |
M.onUpdate | (dtReal, dtSim, dtRaw) | Runs the race test window if open |
M.show | () | Opens the editor and activates race edit mode |
M.loadRace | (filename) | Loads a .race.json file with undo support |
M.saveRace | (race, savePath) | Saves the current race path to JSON |
M.setupRace | () | Opens the race test window |
M.getCurrentPath | () | Returns the current race path object |
M.getCurrentFilename | () | Returns the full file path of the current race |
M.isVisible | () | Returns whether the editor window is visible |
M.allowGizmo | () | Returns whether gizmo operations are allowed |
M.getToolsWindow | () | Returns the tools sub-window |
Sub-Module Tabs
| Tab | Module | Description |
|---|---|---|
| Pathnodes | raceEditor/pathnodes | Create/edit race checkpoint nodes |
| Segments | raceEditor/segments | Define connections between pathnodes |
| Start Positions | raceEditor/startPositions | Place vehicle spawn/recovery positions |
| Track Layout | raceEditor/trackLayout | Configure start/end nodes, laps, classifications |
| Time Trials | raceEditor/timeTrials | Set name, description, difficulty, prefabs |
| Tools | raceEditor/tools | Batch operations, decoration placement, debug |
Menu Structure
| Menu | Items |
|---|---|
| File | Load, Save, Save As, Clear, Copy from Time Trials, All Races browser |
| Preferences | Directional Nodes, Show AI Route, Show Custom Fields, Use Simple Drag |
| Tools | Add Missing Recovery Positions, Recalculate AI Route Distance, Organize Names, Recalculate Segments |
Preferences
| Preference | Type | Default | Description |
|---|---|---|---|
directionalNodes | bool | true | Created pathnodes have a direction |
showAiRoute | bool | false | Preview the AI route |
showCustomFields | bool | false | Show custom field values in world |
useSimpleDrag | bool | false | Experimental simple drag mode |
Notes
- Issues panel in the menu bar shows validation problems (missing nodes, invalid segments).
- Race distance is calculated from the AI detailed path.
- The
testingsub-module provides a standalone race test window with lap timing. - Path object uses
gameplay/race/pathmodule for serialization.
Functions
changedFromExternal()
Handles changed from external.
Returns: self
onEditorToolWindowHide(windowName)
Callback for editor tool window hide event.
windowName(any)
onWindowGotFocus(windowName)
Callback for window got focus event.
windowName(any)
Functions
changedFromExternal()
Handles changed from external.
Returns: self
onEditorToolWindowHide(windowName)
Callback for editor tool window hide event.
windowName(any)
onWindowGotFocus(windowName)
Callback for window got focus event.
windowName(any)
Additional Exports
M.changedFromExternalM.onEditorToolWindowHideM.onWindowGotFocus
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide