Gameplay Achievement
Tracks the "Kilometer Kickoff" Steam/platform achievement - unlocked when total vehicle odometer exceeds 1,000 km (1,000,000 meters).
Tracks the "Kilometer Kickoff" Steam/platform achievement - unlocked when total vehicle odometer exceeds 1,000 km (1,000,000 meters).
Public API
| Function | Signature | Returns | Description |
|------
| M.dependencies | table | {"gameplay_statistic"} |----|-----------|---------|-------------|
| M.statCallback | (key, oldvalue, newvalue) | nil | Callback for odometer statistic changes |
Hooks
| Hook | Purpose |
|---|---|
M.onExtensionLoaded | Checks if achievement already unlocked; registers stat callback if not |
Dependencies
gameplay_statistic
How It Works
- On load, checks if
KILOMETER_KICKOFFis already unlocked viaOnlineServiceProvider - If not unlocked, reads current
vehicle/total_odometer.lengthstat - If already over 1,000,000m, unlocks immediately
- Otherwise, registers a callback on the odometer stat
- Callback updates
KMPASSEDplatform stat (in km) on each change - When threshold exceeded, unlocks achievement and unloads itself
Usage Examples
-- Extension loads automatically and self-manages
-- No manual interaction needed
-- The stat callback is registered as:
gameplay_statistic.callbackRegister("vehicle/total_odometer.length", false, M.statCallback)Notes
- Self-unloading: removes callback and calls
extensions.unload("gameplay_achievement")after unlock - Returns
falsefromonExtensionLoadedto prevent loading if already unlocked - Platform stat
KMPASSEDis set in kilometers (value * 0.001)
Module Variables
| Variable | Type | Description |
|---|---|---|
M.dependencies | table | {"gameplay_statistic"} |
See Also
- Gameplay City - Related reference
- discover - Discover / Experience System - Related reference
- Force Field - Related reference
- Gameplay Systems Guide - Guide
Freeroam Facilities Fuel Price
Manages fuel price display on gas station 7-segment signs. Reads price configuration from facility data, applies randomness, and renders prices via TSStatic shape swapping.
Gameplay City
Loads and queries city-level site data (zones, parking spots) with priority-based zone lookups. Used for level metadata like traffic rules, vehicle groups, and delivery routing.