Gameplay Statistic
Centralized reporting hub for vehicle gameplay metrics and achievements. Collects data from watcher sub-modules and aggregates statistics like airtime, burnouts, and distance traveled.
Centralized reporting hub for vehicle gameplay metrics and achievements. Collects data from watcher sub-modules and aggregates statistics like airtime, burnouts, and distance traveled. Results are sent to the GE layer for achievement tracking and UI display.
Public API
| Function | Signature | Description |
|---|---|---|
metricAdd | (name, value, aggregate) | Adds a named metric value with an aggregation strategy (sum, max, etc.). Called by watcher sub-modules. |
Hooks
| Hook | Description |
|---|---|
onExtensionUnloaded | Flushes any pending metrics to the GE layer before cleanup. |
Sub-Modules
| Module | Description |
|---|---|
| watchAirtime | Tracks vehicle airtime duration |
| watchBurnout | Tracks tire burnout events |
Usage Example
-- Report a metric from a watcher module
extensions.gameplayStatistic.metricAdd("airtime", 2.5, "sum")See Also
- Gameplay Interface — External system bridge
- Odometer — Distance tracking
Gameplay Interface
Unified bridge between external game systems and the vehicle Lua environment. Routes requests and notifications from the Game Engine to specialized handler modules.
Input Analyzer
Detects specific user input sequences such as cheat codes or button combos. Monitors controller and keyboard inputs each frame to match predefined patterns.