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.
Unified bridge between external game systems and the vehicle Lua environment. Routes requests and notifications from the Game Engine (GE) to specialized handler modules for AI control, electrics, powertrain, recovery, and more.
This is the main entry point for GE-to-vehicle communication. It delegates to sub-modules in the gameplayInterfaceModules/ directory.
Hooks
| Hook | Description |
|---|---|
onInit | Loads all gameplay interface sub-modules and registers their action/lookup handlers. |
Sub-Modules
| Module | Description |
|---|---|
| interactAI | AI behavior control (mode, speed, waypoints) |
| interactBeamstate | Vehicle structural state queries and modifications |
| interactCargoContainers | Cargo container attachment and management |
| interactController | Input controller and drive mode management |
| interactElectrics | Electrical system queries (lights, signals, gauges) |
| interactEnergyStorage | Fuel tank and battery state management |
| interactFire | Vehicle fire simulation control |
| interactMisc | Miscellaneous vehicle actions (horn, paint, etc.) |
| interactPartCondition | Part wear and damage condition management |
| interactPowertrain | Powertrain device queries and control |
| interactRecovery | Vehicle recovery and respawn handling |
| interactVehiclePerformanceData | Performance data collection triggers |
Usage Example
-- The gameplay interface is loaded automatically on vehicle spawn
-- GE code communicates with it via:
obj:queueGameEngineLua("extensions.gameplayInterface.action('setAiMode', {mode = 'span'})")See Also
- Gameplay Statistic — Metric reporting hub
- TechCore — External research API (similar bridge pattern)
Vehicle Extensions Overview
This directory contains modular extensions that provide specialized functionality for vehicles. These range from UI helpers to low-level Tech sensor integrations.
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.