API ReferenceGE ExtensionsClient
Client Parse Args
Parses command-line arguments passed to the BeamNG engine, handling flags for logging, display, vehicles, levels, Lua execution, and tech communication.
Parses command-line arguments passed to the BeamNG engine, handling flags for logging, display, vehicles, levels, Lua execution, and tech communication.
Module Overview
| Property | Value |
|---|---|
| Source | lua/ge/client/parseArgs.lua |
| Returns | Module table M |
| Dependencies | tech/techCore (optional, for -tcom) |
Module State
| Field | Type | Description |
|---|---|---|
M.args | table | Parsed arguments (e.g., vehicleConfig) |
Public Functions
| Function | Args | Returns | Description |
|---|---|---|---|
M.defaultParseArgs | - | - | Parses $Game::argc / $Game::argv* console variables |
Supported Command-Line Arguments
| Argument | Next Arg | Description |
|---|---|---|
-log | <mode> | Set log mode (0, 1, 2); dumps existing console first |
-cefdev | - | Enable CEF developer console |
-fullscreen | - | Force fullscreen mode |
-windowed | - | Force windowed mode |
-vehicleConfig | <path> | Set vehicle config (e.g., "pickup/myConfig.pc") |
-vehicle | <arg> | Set $beamngVehicleArgs variable |
-luafile | <file> | require() a Lua file at startup |
-lua | <code> | Queue Lua code string for execution |
-onLevelLoad_ext | <ext> | Queue extension to load on level load |
-level | <name> | Set $levelToLoad for auto-loading |
-worldeditor | - | Deprecated (logs error, suggests -worldEditor) |
-tcom | - | Load tech/techCore extension and open server |
-tcom-capture | - | Load tech/techCore extension only |
Helper Functions (Local)
| Function | Args | Returns | Description |
|---|---|---|---|
pushFront | list, token, delim | string | Prepend token to delimited list |
pushBack | list, token, delim | string | Append token to delimited list |
popFront | list, delim | string | Remove first token from list |
Console Variables Read
| Variable | Purpose |
|---|---|
$Game::argc | Argument count |
$Game::argv0 ... $Game::argvN | Individual arguments |
Console Variables Set
| Variable | By Flag | Value |
|---|---|---|
$logModeSpecified | -log | true |
$beamngVehicleArgs | -vehicle | Next arg |
$levelToLoad | -level | Next arg |
Usage Example
local parseArgs = require("client/parseArgs")
parseArgs.defaultParseArgs()
-- Access parsed args
if parseArgs.args.vehicleConfig then
-- Load specific vehicle config
endNotes
- Arguments are read from TorqueScript
$Game::argv*variables, not Luaarg. -tcomerrors are caught withpcallfor graceful failure.-worldeditoris explicitly deprecated in favor of-worldEditor(camelCase).
See Also
- client/init - Client startup (called after arg parsing)
Objects Required for Startup
Creates all GUI control profiles and the default cursor required before any UI can be displayed. This is one of the first modules loaded during engine initialization.
Client PostFX Manager
Central manager for all post-processing effects (PostFX). Handles initialization, preset loading/saving, backup/restore, and per-effect settings synchronization (SSAO, HDR, DOF, LightRays).