Taxi Ride System
Reference for `gameplay_taxi`, which manages the full taxi ride experience - finding nearby taxis, hailing, entering, choosing a destination via the big map, AI-driven travel, idle camera, skip/telepo
Reference for gameplay_taxi, which manages the full taxi ride experience - finding nearby taxis, hailing, entering, choosing a destination via the big map, AI-driven travel, idle camera, skip/teleport, and exiting.
Module Exports (M)
| Function | Signature | Description |
|---|---|---|
startTaxiWithCurrentRoute | (skipWait?) | Starts the taxi driving along the current route planner path |
Hooks (Event Handlers)
| Hook | Description |
|---|---|
onUpdate | Main loop: detects nearby taxis, manages ride steps, blinkers, idle camera |
onVehicleSwitched | Handles entering/exiting the taxi |
onGameplayInteract | Player interaction: stop driving taxi or hail nearby taxi |
onChangeDestinationCalled | Re-opens big map to change destination mid-ride |
onHurryUpCalled | Placeholder for speed-up feature |
onSkipCalled | Teleports taxi near destination (fade-to-black skip) |
onTrafficVehicleRespawned | Clears ignore list for respawned taxis |
Internals
Ride Steps
| Step | Description |
|---|---|
nothing | No taxi interaction active |
taxiCalled | Taxi is pulling over to pick up the player |
chooseDestination | Player is in taxi, big map open for destination selection |
taxiDriving | Taxi AI driving to destination |
taxiPullingOver | Taxi pulling over at destination |
M.onChangeDestinationCalled | () |
M.onGameplayInteract | () |
M.onHurryUpCalled | () |
M.onSkipCalled | () |
M.onTrafficVehicleRespawned | (id) |
M.onUpdate | (dtReal, dtSim, dtRaw) |
M.onVehicleSwitched | (oldId, newId) |
M.startTaxiWithCurrentRoute | (skipWait) |
Key Systems
- Taxi detection: Scans all map objects for vehicles with "taxi" in their config name, within 20m and below 150 km/h speed limit roads
- Blinker system: Activates pull-over indicators (right for right-hand-drive), hazard lights when stopped, merge signal when departing
- Idle camera: Switches to external camera after 7s of no mouse rotation during taxi ride; reverts on input
- Skip/teleport: Fades to black, teleports taxi to a waypoint near destination, temporarily speeds up physics (2x), then fades back
- Walking integration: Uses
gameplay_walkto manage vehicle blacklist (taxi becomes enterable/exitable)
Route Building
The getAiPath() function converts core_groundMarkers.routePlanner path into AI waypoints:
- Finds the first waypoint ahead of the vehicle (using dot product with forward vector)
- Records a skip position for teleport functionality
- Sets AI with aggression 0.3, avoid cars on, drive in lane, speed limit mode
How It Works
- Player walks near a taxi → "Press [interact] to stop it" message shown
onGameplayInteractcallscallAndStopTaxi()→ taxi AI pulls over, becomes player-usable- Player enters taxi →
onVehicleSwitchedopens big map in taxi mode - Player sets route →
startTaxiWithCurrentRoute()sends AI path, starts driving - Near destination (< 100m) → "almost arrived" message; at 30m → auto pull over
- Player exits taxi → returns to walking mode, taxi resumes traffic AI
Usage Example
-- Programmatically start a taxi ride with current route
gameplay_taxi.startTaxiWithCurrentRoute()
-- Skip to near destination
gameplay_taxi.onSkipCalled()See Also
- Gameplay Achievement - Related reference
- Gameplay City - Related reference
- discover - Discover / Experience System - Related reference
- Gameplay Systems Guide - Guide
Gameplay Statistics
Reference for `gameplay_statistic`, the central metrics engine that records, persists, and reports gameplay statistics. Supports both global and career-scoped data with timers, callbacks, and a schedu
Traffic System
Reference for `gameplay_traffic`, the master traffic system that spawns, manages, respawns, and pools AI traffic vehicles. This is the central orchestrator for all traffic behavior.