Quick Race Loader
Discovers available quick race tracks across all levels, loads track configurations, supports track editor tracks, and assembles complete scenario data for the quick race system.
Discovers available quick race tracks across all levels, loads track configurations, supports track editor tracks, and assembles complete scenario data for the quick race system.
Internal State
| Field | Type | Description |
|---|
Public API
| Function | Signature | Description |
|---|---|---|
M.getQuickraceList | () → table | Returns all levels with their available quick race tracks |
M.getLevel | (levelName) → table | Gets a specific level's quick race data |
M.getLevelTrack | (levelName, trackName) → table | Gets a specific track from a level |
M.getTracks | (quickraceFiles, levelName, lvlName) → table | Parses track JSON files for a level |
M.getTrackEditorTracks | () → table | Loads all user-created track editor tracks |
M.loadTrackBuilderJSON | (originalFilename) → table | Reads a track editor JSON file |
M.getLevelList | () → table | Lists all level folder names |
M.loadQuickrace | (scenarioKey, scenarioFile, trackFile, vehicleFile, raceType) → table | Assembles complete scenario data |
M.startQuickrace | (scenarioFile, trackFile, vehicleFile, type) | Starts a quick race scenario |
M.customPreviewLoader | (levelInfo, levelName) → table | Loads preview images for a level |
M.uiEventStartHotlapping | () | Starts hotlapping mode from freeroam |
M.uiHotlappingAppDestroyed | () | Unloads hotlapping when app closes |
Track Discovery Flow
getLevelList() → for each level:
├─ Find /levels/<name>/quickrace/*.json
├─ getTracks() → parse each track file
├─ getTrackEditorTracks() → user tracks from /trackEditor/
└─ Merge into level.tracks[]Track File Structure
Each track JSON file produces:
| Field | Description |
|---|---|
name | Display name |
trackName | Internal identifier |
lapCount | Number of laps (1 for open, configurable for closed) |
closed | Whether the track is a loop |
reversible | Whether reverse mode is available |
allowRollingStart | Rolling start option |
spawnSpheres | Spawn point names for each start mode |
tod | Time of day preset (0–9) |
prefabs / reversePrefabs / forwardPrefabs | Track decoration prefabs |
raceFile | Optional .race.json path file |
luaFile | Optional custom Lua logic |
Scenario Assembly (loadQuickrace)
- Merges track and vehicle data into scenario file
- Auto-discovers prefabs (
<trackName>.prefab,<trackName>_reverse.prefab) - Reverses lap config if
track.reverseis true - Sets start timer checkpoint for rolling starts
- Configures time-of-day from track preset
- Marks as
isQuickRace = true - Processes through
scenario_scenariosLoader.processScenarioData
Track Editor Integration
- Reads
trackEditor/*.jsonfiles - Supports versioned format only (rejects old formats)
- Auto-generates spawn sphere names, preview images, and prefab lists
- Groups tracks by level (defaults to
smallgrid)
Key Notes
- Required modules stored in
M.quickRaceModules(scenarios, statistics, waypoints, quickRace, hotlapping) - Supports delayed start when a mission is already loaded (unloads first)
- Procedural tracks handled separately (filtered by
file.proceduralflag) - Preview images searched as
<trackName>.jpgand<trackName>_reverse.jpg - Official content detected via
isOfficialContentVPath
Additional Exports
M.triggerDelayedStart- (undocumented)
See Also
- Scenario Bus Driver - Bus Route Scenario Logic - Related reference
- Scenario Damage Goal - Damage-Based Win/Fail Condition - Related reference
- Scenario Demolition Derby - Last Vehicle Moving Wins - Related reference
- Scenario System Guide - Guide
Quick Race
Handles the runtime logic for quick race scenarios: vehicle spawning, prefab loading, waypoint generation from race paths, lap timing, highscore recording, and time-of-day setup.
Race Markers
Central manager for all race checkpoint markers. Creates, pools, positions, and updates marker objects. Supports swappable marker types and delegates rendering to individual marker instances.