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.
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.
Functions/Exports
None (environment setup script).
What It Sets Up
- Package paths - sets
package.pathto include console, gui, common, socket, and root lua directories - Extensions system - loads
extensionsmodule and adds ge/common extension paths - Core libraries - requires:
luaCore,common/cdefs,utils,mathlib - Engine stub - creates
Engine.Profilerwith no-oppushEvent/popEventfunctions
Usage
require("lua/console/main") -- or rerequire
-- Environment is now ready for console scriptsInternal Notes
- Must be loaded before other console scripts that depend on the standard BeamNG Lua environment
Engineglobal is a minimal stub (no real engine in console mode)- Clears
package.cpath(no C modules in console mode)
json-performance Reference
Script defined in `lua/console/json-performance.lua`. Comprehensive serialization performance benchmark comparing JSON, lpack, lpack binary, and string.buffer encode/decode speeds.
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.