API ReferenceGE Extensionscore
Mod Manager
Core mod management system. Discovers, validates, mounts, activates/deactivates, packs/unpacks mod ZIP files and unpacked mod directories. Persists mod state in `mods/db.json`.
Core mod management system. Discovers, validates, mounts, activates/deactivates, packs/unpacks mod ZIP files and unpacked mod directories. Persists mod state in mods/db.json.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.isReady | () → boolean | Returns whether the mod manager has finished initialization |
M.initDB | () | Background job: scans /mods/, mounts active mods, runs modScripts |
M.onUiReady | () | Triggered when UI is ready - loads DB and starts initDB |
M.onFileChanged | (filename, type) | Reacts to ZIP file changes in /mods/ |
M.requestState | () | Sends mod list and vehicle list to UI |
M.activateMod | (modname) | Mounts and activates a mod |
M.activateModId | (modID) | Activates by mod repository ID |
M.activateAllMods | () | Activates all known mods |
M.deactivateMod | (modname, preventStateChange) | Unmounts and deactivates a mod |
M.deactivateModId | (modID) | Deactivates by mod repository ID |
M.deactivateAllMods | () | Deactivates all mods |
M.deleteMod | (modname) → boolean | Unmounts and deletes a mod's files |
M.deleteAllMods | () | Deletes all repo mods and unsubscribes |
M.unpackMod | (modname) | Extracts a ZIP mod to /mods/unpacked/ |
M.packMod | (dirPath) | Re-packs an unpacked mod back to ZIP |
M.checkMod | (modname) → boolean | Validates mod file hashes and checks conflicts |
M.checkUpdate | () | Background job: checks for mod updates via online API |
M.getModDB | (modname) → table | Returns the full database entry for a mod |
M.getConflict | (modname) → table | Returns file conflicts for a mod |
M.modIsUnpacked | (modname) → boolean | Whether the mod is in unpacked form |
M.getModFromPath | (vfsPath) → table | Looks up which mod owns a VFS path (slow!) |
M.getModNameFromID | (modID) → string | Converts a repository ID to a mod name |
M.getModForFilename | (filename) → modname, mod | Finds the mod that owns a virtual file |
M.getMods | () → table | Returns the full mods table |
M.getStats | () → {zip, unpacked, disabled} | Returns mod counts by category |
M.updateZipMod | (oldFile, newFile) | Replaces a mod ZIP (delete old, rename new) |
M.enableModsAfterUpdate | () | Clears the update-disable flag and re-initializes |
M.enableAutoMount | () | Re-enables auto-mounting and re-scans |
M.disableAutoMount | () | Temporarily disables auto-mounting |
M.getPossiblyBrokenMods | () → table | Lists mods that override vanilla files |
M.openEntryInExplorer | (filename) | Opens mod folder in system file explorer |
M.openModFolderInExplorer | () | Opens /mods/ in system file explorer |
M.workOffChangedMod | (filename, type) | Processes a newly added/modified mod file |
M.check4Update | () | Flags for update check on next startup |
M.dependencies | Table. Required extensions: {'core_versionUpdate'} | |
M.getModFromPathSUPERSLOW(vfsPath) | Backward compat alias for getModFromPath. Very slow - avoids unless necessary. |
Mod Database Entry
| Field | Type | Description |
|---|---|---|
modname | string | Lowercase name derived from filename |
fullpath | string | Full VFS path to the mod file/folder |
active | boolean | Whether the mod is currently mounted |
modType | string | "vehicle", "terrain", "app", "scenario", "sound", "unknown" |
modID | string | Repository tag ID |
modData | table | Parsed info.json from the mod |
mountPoint | string | Override mount path for old-format mods |
unpackedPath | string | Path if unpacked |
Dependencies
core_versionUpdate- Detects game version changes to disable mods after update
Module State
| Variable | Type | Default |
|---|---|---|
dependencies | table | { "core_versionUpdate" } |
getModFromPathSUPERSLOW | varies | getModFromPath |
Notes
- Mods are persisted in
mods/db.jsonwith a version 1.1 header. - Safe mode disables mod loading entirely.
modScript.luafiles inside mods are auto-executed on activation.- Duplicate mods are detected by both filename and repository ID.
getModFromPathis explicitly slow - use sparingly.
See Also
- repository - Online mod repository and downloads
- online - Network API calls
- jobsystem - Background task execution
Metrics
ImGui-based performance metrics overlay. Displays FPS, frame times, GPU wait times, and detailed rendering statistics with three display modes.
Multiseat
Local multiplayer input assignment. Maps input devices (keyboards, gamepads) to player slots and seats players into vehicles. Supports up to 64 simultaneous players.