RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

bananabench-async Referencebananabench-csv Referencebananabench-json Referencebananabench-print Referencebananabench-xml Referencebananabench Referencebenchphysics ReferenceBeamConsole Folder Overviewjson-performance Referencemain Referenceresave-pcs Referenceservertests Referencesimpleload Referencesimtest Referencetest_dyncol Referencetest Referenceunittests Reference

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 Referenceconsole

resave-pcs Reference

Script defined in `lua/console/resave-pcs.lua`. Utility that iterates through all vehicles and re-saves their `.pc` (part configuration) files, useful for migrating or normalizing config formats.

Script defined in lua/console/resave-pcs.lua. Utility that iterates through all vehicles and re-saves their .pc (part configuration) files, useful for migrating or normalizing config formats.


Functions/Exports

getAllVehicles() (local)

Scans vehicles directory, returns list of vehicle directory names.

getConfigList(vdir) (local)

Scans a vehicle directory for .pc files, returns list of config filenames.

ResaveConfigs() (global)

Main function - iterates all vehicles, spawns each one, loads each .pc config via partmgmt.loadLocal(), then saves it back via partmgmt.saveLocal().

  • Skips: common, box, bathtub vehicles
  • Reports total configs resaved

Usage

beamng -console lua/console/resave-pcs.lua
# Automatically runs ResaveConfigs()

Internal Notes

  • Spawns vehicles via BeamEngine:spawnObject to initialize them before config resave
  • Uses queueLuaCommand to execute part management commands on the vehicle object
  • Calls BeamEngine:update(2, 2) after each config load/save to process queued commands
  • Auto-executes ResaveConfigs() at module load

main Reference

Script defined in `lua/console/main.lua`. Bootstrap/initialization script that sets up the Lua environment for console mode, configuring package paths and loading core dependencies.

servertests Reference

Script defined in `lua/console/servertests.lua`. Simple test runner entry point that loads and executes the unit tests module.

On this page

Functions/ExportsgetAllVehicles() (local)getConfigList(vdir) (local)ResaveConfigs() (global)UsageInternal Notes