Crash Test Task List
Reference for `gameplay_crashTest_crashTestTaskList`, which manages the in-game task list UI for crash test missions, showing step objectives and their completion status.
Reference for gameplay_crashTest_crashTestTaskList, which manages the in-game task list UI for crash test missions, showing step objectives and their completion status.
Overview
This extension builds and updates task list entries displayed to the player during crash test missions. Each step becomes a task with a label describing the objective and a subtext with specific requirements (speed, damage, etc.).
Exports
| Function | Signature | Description |
|---|---|---|
setCrashTestDataAndInit | (crashTestData) | Initialize the task list with all step data |
onNewCrashTestStep | (stepData) | Mark a step as the active task |
onCrashTestStepFailed | (stepData) | Mark a step as failed |
finishedCurrentTask | (stepData) | Mark a step as completed |
reset | () | Clear all tasks from the UI |
onExtensionUnloaded | () | Cleanup on extension unload |
Internals
Task Label Building
Labels are generated based on the step's objective:
"Simple crash"→"Step N: Crash into the marked target(s)""Crash target vehicle into target area"→"Step N: Redirect the target into the highlighted area"
Task Subtext Building
Subtexts combine speed requirements and damage conditions:
- Speed:
"At 80 km/h"(translated to user's unit preference) - Damage conditions like
"Minimize damage","At least Moderate damage","Maximize damage"
How It Works
setCrashTestDataAndInit()stores the step data, sets the header, and shows the first task- As steps progress,
onNewCrashTestStep()activates each step in the task list finishedCurrentTask()marks steps as done (green checkmark)onCrashTestStepFailed()marks steps as failed (red X)
-- Initialize with sanitized step data
gameplay_crashTest_crashTestTaskList.setCrashTestDataAndInit(sanitizedStepsData)
-- When a step is completed
gameplay_crashTest_crashTestTaskList.finishedCurrentTask(currentStepData)
-- When a step fails
gameplay_crashTest_crashTestTaskList.onCrashTestStepFailed(currentStepData)GUI Hooks Used
| Hook | Purpose |
|---|---|
SetTasklistHeader | Sets the header: "Crash analysis steps" |
SetTasklistTask | Creates/updates individual task entries |
M.finishedCurrentTask | (stepData) |
M.onCrashTestStepFailed | (stepData) |
M.onExtensionUnloaded | () |
M.onNewCrashTestStep | (stepData) |
M.reset | () |
M.setCrashTestDataAndInit | (crashTestData_) |
Each task uses type = "goal" and is identified by the player vehicle ID for that step.
Key Behaviors
- Only the first task is shown on initialization; subsequent tasks appear as steps progress
- Task IDs are derived from the player vehicle ID (
stepData.plVehId) - The
attentionflag highlights the current active task - Clearing a task sets
clear = trueon theSetTasklistTasktrigger
See Also
- crashTestBoundaries - Crash Test Boundary Checking - Related reference
- crashTestCountdown - Crash Test Countdown Timer - Related reference
- crashTestScoring - Crash Test Score Calculation - Related reference
- Gameplay Systems Guide - Guide
Crash Test Scoring
Reference for `gameplay_crashTest_crashTestScoring`, which calculates and aggregates scores for crash test mission steps based on time, speed, damage, and impact location accuracy.
Crash Test Scenario Manager
Reference for `gameplay_crashTest_scenarioManager`, the main orchestrator for crash test missions. Manages multi-step crash test scenarios including vehicle setup, AI control, crash detection, scoring