API ReferenceGE Extensionscore
Version Update
Detects game version changes on startup and performs folder cleanup when a major version update is detected.
Detects game version changes on startup and performs folder cleanup when a major version update is detected.
Public API
| Function | Signature | Description |
|---|---|---|
M.updatedFromVersion | () | Returns the previous version string, or nil if no update occurred |
Hooks
| Hook | Description |
|---|---|
M.onExtensionLoaded | Compares current vs last version; runs FS:folderCleanup() on major update |
M.onUpdate | Saves current version to settings (runs once then self-removes) |
M.lastVersion | The last known game version (default nil). |
Internal Logic
- Reads
settings.lastVersionand compares major version (X.Y) - Skips cleanup on new installs (
onlineFeatures == "ask") or same major version - On major update: calls
FS:folderCleanup(lastVersion)which backs up and cleans user files - Stores the backup destination path internally
- On next frame: writes
beamng_versiontosettings.lastVersion
Usage Example
-- Check if game was just updated
local prevVer = extensions.core_versionUpdate.updatedFromVersion()
if prevVer then
log("I", "", "Updated from " .. prevVer)
endVehicle Triggers
Handles interactive vehicle triggers (buttons, levers, switches) that appear on vehicles. Manages cursor-based raycasting, input action binding, and a debug ImGui window.
Weather System
Loads and applies weather presets that modify scene object properties (fog, sky, lighting). Supports instant activation or smooth time-based transitions.