Glossary
Terms used throughout this wiki that either aren’t standard Lua vocabulary or mean something specific in this game’s engine.
uGuid- A unique handle identifying one live world-object instance at runtime (a spawned crate, vehicle, character, etc.). Most engine calls that operate on “an object” take a
uGuidas their first argument. Not stable across game sessions — it’s a runtime handle, not a permanent ID. - module
- A single
.luafile, addressed by its filename without the extension.crate.luadefines the moduleCrate. There’s norequire— every module is just a global table the engine loads and wires up viainherit/import. - engine namespace
- A built-in table like
Object,Event,Player,Marker,Sound— these are provided by the engine itself, not defined by any.luamodule in this corpus. You call into them (Object.GetPosition(...)) but won’t find their implementation inresident/, and they’re always globally callable — noimport()needed, from anywhere. Don’t confuse these with resident-module namespaces likeMrxPmc(see below) — the two look identical to call, but behave very differently outside a module’s own file. inherit("Name")- Declared at the top of a module, makes it prototype-inherit from another module’s table. See the Resident Modules landing page for the full explanation with examples.
import("Name")- Pulls another module in as a callable namespace, without inheriting from it. Important, confirmed by live testing: this only populates the importing file’s own environment. A
resident/module that doesimport("MrxPmc")can then callMrxPmc.Whatever(...)freely inside its own functions — but a console chunk orOnBoot/OnLoad/OnKeyscript has no such import, soMrxPmc.AddCashQty(...)from one of those fails withattempt to index global 'MrxPmc' (a nil value). Fix: callimport("MrxPmc")yourself, at the top of the script, before using it. This does not apply to functions a module explicitly publishes with_G.Name = ...(e.g._G.Cheat.DisplayOptions,_G.DebugTeleport) — those are real globals and work from anywhere, because the function itself was defined inside its module and carries that module’s environment with it as a closure, even though its name is reachable globally. getfenv()- Stock Lua 5.1 built-in returning the calling function’s environment table — in this codebase, that’s almost always used as a way for a module to refer to itself (its own global table, i.e. “the class”) from inside one of its own functions. See the
Awake/Createidiom on the Resident Modules page. - instance / per-instance table
- The table created by
Create(oPrototype, uGuid, ...)for one specificuGuid, with the module’s own table set as its metatable__index. Fields you set on the instance override the module’s shared defaults for that one object only. OnActivate/OnDeactivate/OnDeath- Lifecycle functions the engine calls directly when a world-object instance is spawned, torn down, or its underlying object dies. Not arbitrary names — see the lifecycle table on Resident Modules.
Event.Create/Event.CreatePersistent/Event.Delete- Subscribe to (or unsubscribe from) an engine event — a timer firing, an object leaving hibernation, a winch state changing, etc.
Event.Createreturns a handle you pass toEvent.Deletelater. KEYVAL- A convention (not a language feature) for
scripts/OnKey/scripts: putlocal KEYVAL = "insert"(or any key name) somewhere in the script’s first 10 lines, and the script loader reads it as that script’s default hotkey, no config file edit required. See Your First Mod. [ok]/[runtime]/[compile]/[bridge]- Prefixes on lua-bridge REPL responses.
[ok]= ran successfully,[runtime]= ran but errored,[compile]= syntax error,[bridge]= the bridge itself couldn’t run your code at all (see the error table in Getting Started). float, notdouble- This build’s Lua uses 4-byte floats for
lua_Number, not the 8-byte doubles a stock Lua 5.1 build would use. Numbers can lose precision you wouldn’t expect from “normal” Lua — see Getting Started for details. Loader.Printf- lua-bridge’s own debug-print function, writing to its dedicated
lua_loader_print.loginstead of the base game’s noisy shared log. Use this, not the engine’sDebug.Printf, for your own debug output — see Getting Started. MrxPmc- A resident module (
resident/mrxpmc.lua), not an engine namespace — despite reading like one. Tracks player-economy state (cash, fuel, fuel capacity) as a thin wrapper around the lower-levelPlayer.*primitives (Player.SetCash,Player.AddFuel, …), adding capacity clamping, HUD-refresh events, and stats tracking on top. Needsimport("MrxPmc")before use outside a module file — see theimport("Name")entry above. Confirmed by live testing: callingPlayer.SetCash(...)directly does change the underlying value, but skips the HUD refreshMrxPmc.AddCashQty(...)triggers — the number won’t visibly update on-screen even though it changed. UseMrxPmc.AddCashQty/AddFuelQtyif you want the displayed value to update too. Pg- Broad world/level-state queries — landing zones, spawn points, contract state, achievements, “collect all objects of type X in the world” helpers. Likely short for “Playground” (the exact expansion isn’t confirmed), but functionally: world-wide queries, as opposed to per-player state (
Player) or per-object state (Object).