RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Career BranchesCareer System CoreCareer Save System

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 Extensionscareer

Career Save System

Manages career save slots with rotating autosaves. Handles save/load, slot management, corruption detection, and async extension saving.

Manages career save slots with rotating autosaves. Handles save/load, slot management, corruption detection, and async extension saving.


Public API

FunctionSignatureReturnsDescription
M.setSaveSlot(slotName, specificAutosave)booleanSets active save slot (loads newest or specific autosave)
M.removeSaveSlot(slotName)nilDeletes a save slot directory
M.renameSaveSlot(slotName, newName)booleanRenames a save slot
M.getCurrentSaveSlot()string, stringReturns slot name and save path
M.saveCurrent(vehiclesThumbnailUpdate)nilSaves current career state to oldest autosave
M.getAllSaveSlots()tableLists all save slot folder names
M.getSaveRootDirectory()stringReturns "settings/cloud/saves/"
M.getAutosave(path, oldest)string, stringGets newest/oldest autosave path and date
M.getAllAutosaves(slotName)tableAll autosaves for a slot, sorted by date
M.getSaveSystemVersion()numberCurrent save system version (61)
M.getBackwardsCompVersion()numberMinimum compatible version (36)
M.saveFailed()nilMarks current save as failed
M.registerAsyncSaveExtension(extName)nilRegisters an extension for async saving
M.asyncSaveExtensionFinished(extName)nilSignals async save completion
M.jsonWriteFileSafe(filename, obj, pretty, numberPrecision, tempFileName)booleanAtomic JSON write (temp file + rename)

Hooks

HookPurpose
M.onExtensionLoadedNo-op placeholder
M.onSerializeSaves slot state for Lua reload
M.onDeserializedRestores slot state after Lua reload

Save Architecture

  • Root: settings/cloud/saves/
  • Slots: Named folders under root
  • Autosaves: 3 rotating autosave folders per slot (autosave1, autosave2, autosave3)
  • Each autosave has info.json with version, date, creationDate, corrupted

Save Flow

  1. Find oldest autosave to overwrite
  2. Write info.json with corrupted = true
  3. Fire onSaveCurrentSaveSlotAsyncStart and onSaveCurrentSaveSlot hooks
  4. Wait for all async extensions to finish
  5. Clear corrupted flag and write final info.json

Usage Examples

-- Save current career
career_saveSystem.saveCurrent()

-- Set active save slot
career_saveSystem.setSaveSlot("career_01")

-- Get current slot info
local slot, path = career_saveSystem.getCurrentSaveSlot()

-- Safe JSON write with atomic rename
career_saveSystem.jsonWriteFileSafe("path/to/file.json", myData, true)

-- List all save slots
local slots = career_saveSystem.getAllSaveSlots()

Notes

  • Saves are skipped during the linear tutorial
  • Corrupted saves are detected via the corrupted flag in info.json
  • Directory names are validated against illegal characters: <>:"/\|?*

Career System Core

M.dependencies = {'career_saveSystem', 'core_recoveryPrompt', 'gameplay_traffic'}

Career Computer Menu

M.dependencies = {"career_career"}

On this page

Public APIHooksSave ArchitectureSave FlowUsage ExamplesNotes