API ReferenceGE Extensionsfreeroam
Freeroam Gas Stations
Manages gas station POI formatting and simple vehicle refueling in freeroam. Defers to career fuel module when career mode is active.
Manages gas station POI formatting and simple vehicle refueling in freeroam. Defers to career fuel module when career mode is active.
Public API
| Function | Signature | Returns | Description |
|---|---|---|---|
M.gasStationCenterRadius | (facility) | vec3, number | Calculates center position and radius from pump objects |
M.formatGasStationPoi | (gasStation) | table | Formats a gas station facility as a POI element |
M.refuelCar | (gasStation, fuelTypes, veh) | nil | Refuels a vehicle at a gas station |
Hooks
| Hook | Purpose |
|---|---|
M.onGetRawPoiListForLevel | Adds gas station POIs if career or setting enabled |
M.onActivityAcceptGatherData | Provides refuel/recharge button for activity accept UI |
Fuel Type Mapping
| Energy Type | Translation Key | Sound |
|---|---|---|
gasoline | refuel | Fueling_Petrol_Simple |
diesel | refuel | Fueling_Petrol_Simple |
electricEnergy | recharge | Fueling_Electric_Simple |
n2o | refuel | Fueling_Petrol_Simple |
any | refuel | Fueling_Petrol_Simple |
The air fuel type is ignored during refueling.
How It Works
- POI Creation:
onGetRawPoiListForLeveliterates facilities, creates POI elements with pump positions and electric/fuel icons - Activity UI: When player enters a gas station zone, the accept UI shows a refuel/recharge button with fuel type props
- Refueling:
refuelCarqueries vehicle energy storage, fills compatible tanks to max, shows success/partial/fail messages - Career Redirect: If career is active, hands off to
career_modules_fuel.startTransaction()instead
Usage Examples
-- Format a gas station as POI
local poi = freeroam_gasStations.formatGasStationPoi(gasStationFacility)
-- Manually refuel
local veh = getPlayerVehicle(0)
local fuelTypes = {gasoline = true, diesel = true}
freeroam_gasStations.refuelCar(gasStationElem, fuelTypes, veh)Notes
- Gas stations appear on bigmap with fuel pump or charge icon depending on energy types
- Refueling uses
core_vehicleBridgeto query and set energy storage - Mixed fuel stations (multiple types) use
refuelMixedtranslation key - POI visibility controlled by
enableGasStationsInFreeroamsetting or career mode
See Also
- Freeroam Big Map Markers - Related reference
- Freeroam Big Map Mode - Related reference
- Freeroam Big Map POI Provider - Related reference
- Freeroam Guide - Guide
Freeroam Configurator
Manages the freeroam configuration screen - level/spawn point selection, vehicle selection, and gameplay options. Persists configuration to disk and provides tile data for the UI.
Freeroam Level Stats
Tracks and persists usage statistics for levels and spawn points. Records spawn counts and timestamps, provides sorted top-level and top-spawn-point queries.