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,bathtubvehicles - Reports total configs resaved
Usage
beamng -console lua/console/resave-pcs.lua
# Automatically runs ResaveConfigs()Internal Notes
- Spawns vehicles via
BeamEngine:spawnObjectto initialize them before config resave - Uses
queueLuaCommandto 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.