API ReferenceGE Extensionsscenario
No-Move Goal
A scenario goal that fails if a vehicle moves from its starting position. Used for parking/brake scenarios where a vehicle must remain stationary.
A scenario goal that fails if a vehicle moves from its starting position. Used for parking/brake scenarios where a vehicle must remain stationary.
Internal State
| Field | Type | Description |
|---|---|---|
M.instances | varies | Assigned as {} |
Public API
| Function | Signature | Description |
|---|---|---|
M.init | (scenario) | Records start positions for all nomove goal vehicles |
M.processState | (scenario, state, stateData) | Checks if vehicle moved > 0.1 units from start |
M.updateFinalStatus | (scenario, instance) | Reports final goal status to statistics system |
Goal JSON Schema
{
"goal": {
"nomove": {
"msg": "scenarios.parking.youMoved",
"triggerEndOnly": false
}
}
}| Field | Type | Default | Description |
|---|---|---|---|
msg | localizedString | required | Failure message |
triggerEndOnly | boolean | false | If true, only triggers scenario end (doesn't set fail status) |
How It Works
initfinds all goals withid == "nomove"and records each vehicle's position- On
onCountdownEnded, refreshes start positions (for scenarios with countdowns) - Each
onRaceTickandonRaceResult:- Calculates distance from start position
- If distance > 0.1 units:
- Normal mode: Sets
result = "failed"and finishes scenario - triggerEndOnly mode: Calls
scenario_scenarios.endScenario(0.25)without setting status
- Normal mode: Sets
- If within threshold: Sets
result = "passed"
Usage Examples
-- Parking brake test: AI vehicle must not move
{
"vehicles": {
"parked_car": {
"goal": {
"nomove": {
"msg": "scenarios.parking.carRolled"
}
}
}
}
}
-- End scenario silently if vehicle moves
{
"nomove": {
"triggerEndOnly": true
}
}Key Notes
- Movement threshold is 0.1 world units (very sensitive)
- In
triggerEndOnlymode, goal status is not set - used for side-effect scenarios - Reports to both the vehicle's own stats and the player vehicle stats
- Logs a warning if the vehicle object is missing, with a one-time flag to prevent spam
- Start position is updated on countdown end (not just init) for countdown scenarios
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