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
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility
Livery Editor - CameraLivery Editor - ControlsLivery Editor - Edit ModeLivery Editor – Editor (Core)Livery Editor – HistoryLivery Editor – Layer ActionLivery Editor – Layer EditLivery Editor – LayersLivery Editor – ResourcesLivery Editor – SelectionLivery Editor – ToolsLivery Editor – User DataLivery Editor – Utils

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 ExtensionsuiliveryEditor

Livery Editor – User Data

Manages livery save files - listing, creating, renaming, and deleting `.dynDecals.json` files.

Manages livery save files - listing, creating, renaming, and deleting .dynDecals.json files.


Overview

ui_liveryEditor_userData provides CRUD operations for livery save files stored in settings/dynamicDecals/. It handles filename validation, file system operations, and notifies the UI when the file list changes.

Extension path: lua/ge/extensions/ui/liveryEditor/userData.lua


Exports (M)

FunctionSignatureDescription
requestUpdatedData()Triggers LiverySaveFilesUpdated with the current save file list.
saveFileExists(filename) → boolChecks if a save file exists by name.
getSaveFiles() → file[]Returns all save files with metadata (name, location, dates, size).
createSaveFile(filename) → path/falseValidates filename and saves the layer stack. Returns the file path.
renameFile(filename, newFilename) → boolRenames an existing save file.
deleteSaveFile(filename) → boolDeletes a save file.
getFilename(file) → stringExtracts the display name from a full file path.

Internals

File Constants

local saveDir = "settings/dynamicDecals/"
local FILENAME_PATTERN = "^[a-zA-Z0-9_-]+$"
local dynDecalsExtension = ".dynDecals.json"

Save File Format

Each file entry returned by getSaveFiles():

{
  name = "mySkin",                              -- display name (no extension)
  location = "settings/dynamicDecals/mySkin.dynDecals.json",
  created = 1703275200,                         -- unix timestamp
  modified = 1703275200,                        -- unix timestamp
  fileSize = 4096                               -- bytes
}

Filename Validation

Only alphanumeric characters, hyphens, and underscores are allowed:

if not string.match(filename, "^[a-zA-Z0-9_-]+$") then
  log("W", "", "Cannot create invalid filename: " .. filename)
  return false
end

File Operations

  • Create: api.saveLayerStackToFile(path) serialises the current layer stack
  • Rename: FS:renameFile(oldPath, newPath) - returns 0 on success
  • Delete: FS:removeFile(path)

All mutations trigger LiverySaveFilesUpdated to refresh the UI file browser.


How It Works

  1. The save directory is scanned for *.dynDecals.json files via FS:findFiles
  2. Each file's stats (creation time, mod time, size) are read via FS:stat
  3. Creating a save validates the filename pattern, then serialises the layer stack
  4. Rename and delete operations validate file existence before proceeding
  5. UI is notified after every mutation

Example Usage

local userData = extensions.ui_liveryEditor_userData

-- List all saves
local files = userData.getSaveFiles()
for _, f in ipairs(files) do
  print(f.name, f.modified)
end

-- Create a new save
local path = userData.createSaveFile("myRacingLivery")

-- Rename
userData.renameFile("myRacingLivery", "myRacingLivery_v2")

-- Delete
userData.deleteSaveFile("myRacingLivery_v2")

Additional Exports

The following exports are available but not yet documented in detail:

  • M.createSaveFile
  • M.deleteSaveFile
  • M.getFilename
  • M.getSaveFiles
  • M.renameFile
  • M.requestUpdatedData
  • M.saveFileExists

Livery Editor – Tools

Central tool manager - switches active tools, manages action maps, and dispatches operations to cursor or layer targets.

Livery Editor – Utils

Math and conversion utilities shared across the livery editor modules.

On this page

OverviewExports (M)InternalsFile ConstantsSave File FormatFilename ValidationFile OperationsHow It WorksExample UsageAdditional Exports