API ReferenceGE Extensionsgameplaydrift
Drift Statistics
Reference for `gameplay_drift_statistics`, which records drift performance metrics into the persistent statistics system (`gameplay_statistic`).
Reference for gameplay_drift_statistics, which records drift performance metrics into the persistent statistics system (gameplay_statistic).
Exports
| Function | Signature | Description |
|---|---|---|
onDriftCrash | () | Increments drift/crashes by 1 |
onDriftCompleted | (data) | Records drift chain stats: left/right drift counts, max distance, max time, max chained drifts |
onDriftCompletedScored | (data) | Adds data.addedScore to drift/totalScore, updates drift/maxDriftScore |
onDriftSpinout | () | Increments drift/spinOuts by 1 |
Statistics Tracked
| Metric | Type | Description |
|---|---|---|
drift/rightDrifts | additive | Total right-hand drifts |
drift/leftDrifts | additive | Total left-hand drifts |
drift/maxDriftDistance.length | max | Longest single drift chain distance |
drift/maxDriftTime.time | max | Longest single drift chain time |
drift/maxChainedDrifts | max | Most drifts chained together |
drift/totalScore | additive | Cumulative drift score |
drift/maxDriftScore | max | Highest single drift score |
drift/spinOuts | additive | Total spinouts |
drift/crashes | additive | Total crashes |
M.onDriftCompleted | (data) | - |
M.onDriftCompletedScored | (data) | - |
M.onDriftCrash | () | - |
M.onDriftSpinout | () | - |
Key Behaviors
- Uses
gameplay_statistic.metricGet/metricSet/metricAddfor persistence onDriftCompletedrequiresdata.chainDriftDatato be non-nil; skips if missing- Max stats use a helper that only updates if the new value exceeds the stored value
See Also
- drift/bounds - Drift Zone Boundary Detection - Related reference
- drift/destination - Race Path & Wrong-Way Detection - Related reference
- drift/display - Drift UI & HUD Management - Related reference
- Gameplay Systems Guide - Guide
Drift Stalling
Reference for `gameplay_drift_stallingSystem`, which penalizes repetitive drift behavior by reducing the score multiplier when the player repeats the same stunts without variety.
Drift Stunt Zones
Reference for `gameplay_drift_stuntZones`, which manages the lifecycle, detection, rendering, and scoring of drift stunt zones (donuts, drift-throughs, hit poles, near poles).