API ReferenceGE Extensionscore
Windows Console
Provides the backend for the Windows debug console window, routing commands to different execution contexts (GE Lua, TorqueScript, CEF/JS, vehicle Lua).
Provides the backend for the Windows debug console window, routing commands to different execution contexts (GE Lua, TorqueScript, CEF/JS, vehicle Lua).
Public API
| Function | Signature | Description |
|---|---|---|
M.executeCommand | (context, cmd) | Executes a command string in the specified context |
M.tryRunCommand | (cmd) | Attempts to run a GE Lua command string, auto-wrapping in return if needed |
M.configure | () | Refreshes the context combo box (called by C++ when console activates) |
Execution Contexts
| Context | Description |
|---|---|
"GE-Lua" | Executed in C++ (doesn't reach Lua handler) |
"GE-TorqueScript" | Evaluated via TorqueScript.eval() |
"CEF/UI - JS" | Queued to the browser via be:queueJS() |
"Current Vehicle - Lua" | Sends to the player vehicle's Lua VM |
"<vehicleName>" | Sends to a specific vehicle's Lua VM |
Hooks
| Hook | Description |
|---|---|
M.onExtensionLoaded | Checks platform support and enables the extension |
M.onVehicleDestroyed | Refreshes context list |
M.onVehicleSwitched | Refreshes context list |
M.onVehicleSpawned | Refreshes context list |
M.onVehicleActiveChanged | Refreshes context list |
Usage Example
-- The console is primarily used interactively via the Windows console window.
-- Programmatic usage:
core_windowsConsole.executeCommand("GE-TorqueScript", 'echo("Hello from TS");')
core_windowsConsole.tryRunCommand('print(be:getObjectCount())')Weather System
Loads and applies weather presets that modify scene object properties (fog, sky, lighting). Supports instant activation or smooth time-based transitions.
Camera Mode: Autopoint
Filter camera that smoothly adjusts the camera's look-at target to a local offset on the vehicle. Used by external/fan cameras to track specific vehicle nodes.