Gameplay Rally Loop
Extension (`gameplay_rallyLoop`) that manages rally loop gameplay - a looping multi-stage rally system. Wraps a `RallyLoopManager` and handles lifecycle, UI streaming, debug toolbox, and mission trans
Extension (gameplay_rallyLoop) that manages rally loop gameplay - a looping multi-stage rally system. Wraps a RallyLoopManager and handles lifecycle, UI streaming, debug toolbox, and mission transitions.
Public API
| Function | Signature | Returns | Description |
|----------
| M.getLoopToolbox | () | any | getLoopToolbox |
| M.getSSRescheduleCount | () | number | getSSRescheduleCount |
| M.setDrawFlag | (flagName, value) | nil | setDrawFlag |
| M.getDrawFlag | (flagName) | boolean | getDrawFlag |
| M.isLoopToolboxVisible | () | any | isLoopToolboxVisible |
| M.setDebugLogging | (val) | nil | setDebugLogging |
| M.getDebugLogging | () | any | getDebugLogging ||-----------|---------|-------------|
| setup | (missionId, missionDir) | nil | Initialize rally loop manager |
| unload | () | nil | Destroy manager |
| isReady | () | bool | Manager is initialized |
| toggleDebug | () | nil | Toggle loop toolbox ImGui window |
| drawDebug | (zOnTop, drawRoute, drawLabels) | nil | Draw debug visualization |
| setupForNewMission | () | nil | Prepare for next mission in loop |
| setMissionExecutionTransferFlag | (val) | nil | Set transfer flag for mission handoff |
| getMissionExecutionTransferFlag | () | bool | Get transfer flag |
| getNextMissionId | () | string? | Next mission in the loop |
| startNextMission | () | bool | Start next mission |
| handleGOTO | (gotoRallyLoop) | nil | Handle navigation: restart, abandon, postServiceIn |
| getManager | () | object? | Direct access to RallyLoopManager |
Extension Hooks
| Hook | Purpose |
|---|---|
onUpdate | Per-frame update, streams data to UI |
onGuiUpdate | GUI-specific update pass |
onExtensionLoaded | Log load event |
onExtensionUnloaded | Send inactive state, log unload |
onRallyDataUpdated | Forward rally data changes |
onGameplayInteract | Handle player interact input |
onUIStartButtonClicked | UI start button handler |
onRecalculatedRoute | Route recalculation event |
onCreatedRallyGroundMarkerRoute | Ground marker route created |
onRallyVehicleRecovery | Track vehicle recovery events |
onAnyMissionWillChange | Handle mission stop/abandon (DNF tracking) |
Internals
rallyLoopManager: CoreRallyLoopManagerinstanceloopToolbox: Optional ImGui debug window (LoopToolbox)streamData: Data streamed to UI viaguihooks.queueStream("rallyLoop", data)- Active states:
inactive,vehicleProximity,stageActive,countdown
How It Works
- Flowgraph calls
setup(missionId, missionDir)to initialize the rally loop onUpdatecalls manager update, then streams state data to the UI layer- UI receives
rallyLoopstream withactiveStateand other loop data handleGOTOroutes navigation commands: restart loop, abandon, or advance to next missiononAnyMissionWillChangerecords DNF attempts when a mission is abandoned mid-stage
-- Setup from flowgraph
gameplay_rallyLoop.setup(missionId, missionDir)
-- Check state
if gameplay_rallyLoop.isReady() then
local mgr = gameplay_rallyLoop.getManager()
end
-- Handle navigation
gameplay_rallyLoop.handleGOTO('restart')Dependencies
gameplay/rally/tools/loopToolbox- debug ImGui windowgameplay/rally/loop/rallyLoopManager- core loop logicgameplay/rally/loop/rallyAttempts- DNF/attempt trackinggameplay/rally/util- constants and utilities
| Function | Signature | Returns | Description |
|---|---|---|---|
M.getDebugLogging | () | nil | getDebugLogging |
M.setDebugLogging | (val) | nil | setDebugLogging |
M.isLoopToolboxVisible | () | nil | isLoopToolboxVisible |
M.getDrawFlag | (flagName) | nil | getDrawFlag |
M.setDrawFlag | (flagName, value) | nil | setDrawFlag |
M.getSSRescheduleCount | () | nil | getSSRescheduleCount |
M.getLoopToolbox | () | nil | getLoopToolbox |
M.drawDebug | (zOnTop, drawRoute, drawLabels) | - | drawDebug handler |
M.getManager | () | - | Returns Manager |
M.getMissionExecutionTransferFlag | () | - | Returns MissionExecutionTransferFlag |
M.getNextMissionId | () | - | Returns NextMissionId |
M.handleGOTO | (gotoRallyLoop) | - | handleGOTO handler |
M.isReady | () | - | Checks if Ready |
M.onAnyMissionWillChange | (state, mission, abandoned) | - | Callback for AnyMissionWillChange event |
M.onCreatedRallyGroundMarkerRoute | () | - | Callback for CreatedRallyGroundMarkerRoute event |
M.onExtensionLoaded | () | - | M.onVehicleActiveChanged = onVehicleActiveChanged |
M.onExtensionUnloaded | () | - | Callback for ExtensionUnloaded event |
M.onGameplayInteract | () | - | Callback for GameplayInteract event |
M.onGuiUpdate | (dtReal, dtSim, dtRaw) | - | Callback for GuiUpdate event |
M.onRallyDataUpdated | (data) | - | Callback for RallyDataUpdated event |
M.onRallyVehicleRecovery | (recoveryType) | - | Callback for RallyVehicleRecovery event |
M.onRecalculatedRoute | () | - | Callback for RecalculatedRoute event |
M.onUIStartButtonClicked | () | - | Callback for UIStartButtonClicked event |
M.onUpdate | (dtReal, dtSim, dtRaw) | - | Callback for Update event |
M.setMissionExecutionTransferFlag | (val) | - | Sets MissionExecutionTransferFlag |
M.setup | (missionId, missionDir) | - | Sets up |
M.setupForNewMission | () | - | Sets upForNewMission |
M.startNextMission | () | - | startNextMission handler |
M.toggleDebug | () | - | toggleDebug handler |
M.unload | () | - | unload handler |
See Also
- Gameplay Achievement - Related reference
- Gameplay City - Related reference
- discover - Discover / Experience System - Related reference
- Gameplay Systems Guide - Guide
Gameplay Rally
Main extension for the rally gameplay system. Manages rally mission loading/unloading, co-driver timing, recce app, rally toolbox debug UI, and integration with race pathnode events.
Gameplay Raw POIs
Extension that manages raw Point of Interest (POI) lists used by the bigmap/minimap. Aggregates POIs from all gameplay systems (missions, facilities, gas stations) with special handling for career tut