RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Freeroam Big Map MarkersFreeroam Big Map ModeFreeroam Big Map POI ProviderFreeroam Crash Cam ModeFreeroam Crash Cam Mode LoaderFreeroam Drag RaceFreeroam FacilitiesFreeroamFreeroam ConfiguratorFreeroam Gas StationsFreeroam Level StatsFreeroam OrganizationsFreeroam Special TriggersFreeroam Vue Big Map

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsfreeroam

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.

Tracks and persists usage statistics for levels and spawn points. Records spawn counts and timestamps, provides sorted top-level and top-spawn-point queries.


Public API

FunctionSignatureReturnsDescription
M.recordLevelSpawn(levelName, spawnPointName?)nilRecords a spawn event for a level/spawn point
M.getTopLevels()tableReturns levels sorted by frequency, most-recent first
M.getTopSpawnPoints(levelName)tableReturns spawn points for a level, sorted by frequency
M.getUiStats()tableReturns combined top levels and spawn points for UI

Storage Format

File: /settings/cloud/uiStats.json

{
  "levels": {
    "west_coast_usa": {
      "count": 15,
      "lastUsed": "2024-01-15T10:30:00Z",
      "spawnPoints": {
        "spawns_industrial": {
          "spawnPointName": "spawns_industrial",
          "count": 8,
          "lastUsed": "2024-01-15T10:30:00Z"
        }
      }
    }
  },
  "vehicles": {}
}

How It Works

  1. recordLevelSpawn() increments counters and updates ISO8601 timestamps for level and spawn point
  2. Default spawn points (no name) stored as "__default__"
  3. getTopLevels() sorts by count (descending) but promotes the most recently used level to first position
  4. getTopSpawnPoints() follows the same sorting strategy per level
  5. Stats cached in memory after first read

Usage Examples

-- Record a level spawn
freeroam_levelStats.recordLevelSpawn("west_coast_usa", "spawns_industrial")

-- Get most-used levels
local topLevels = freeroam_levelStats.getTopLevels()
-- Returns: {{levelName="west_coast_usa", count=15, lastUsed="..."}, ...}

-- Get spawn points for a level
local spawns = freeroam_levelStats.getTopSpawnPoints("west_coast_usa")

Notes

  • Stats file is in the cloud save directory for cross-device sync
  • Timestamps in ISO8601 UTC format
  • The vehicles table exists in the schema but is not currently populated
  • Sorting prioritizes the most recently used entry at position 1, then sorts remainder by count

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 Gas Stations

Manages gas station POI formatting and simple vehicle refueling in freeroam. Defers to career fuel module when career mode is active.

Freeroam Organizations

Loads and manages organization data used in career mode. Organizations have reputation levels, associated facilities, and delivery capabilities.

On this page

Public APIStorage FormatHow It WorksUsage ExamplesNotesSee Also