luaCore Reference
Module defined in `lua/common/luaCore.lua`. Adds core language features and polyfills used throughout the codebase - optional require, module reload, table utilities, and FFI initialization.
Module defined in lua/common/luaCore.lua. Adds core language features and polyfills used throughout the codebase - optional require, module reload, table utilities, and FFI initialization.
Exports
All exports are global functions/variables.
Functions
require_optional(module)
Safely attempts to require a module, returning nil on failure instead of throwing an error.
- Parameters:
module- string - Module path to require
- Returns: table|nil - The loaded module or nil if not found
unrequire(m)
Unloads a previously required module by clearing it from package.loaded and _G.
- Parameters:
m- string - Module name to unload
rerequire(module)
Force-reloads a module from disk by clearing the cache first, then requiring it again.
- Parameters:
module- string - Module path to reload
- Returns: table|nil - The freshly loaded module
nop()
A no-operation function. Used as a placeholder/default callback throughout the codebase.
Variables
ffi
- Type: table|nil
- Description: Global reference to the LuaJIT FFI library, set via
require_optional('ffi'). Nil if FFI is unavailable.
Internal Notes
- Also polyfills
table.clearandtable.newif the LuaJIT extensions aren't available - Must be loaded very early in initialization as many other modules depend on
ffi,nop,require_optional
luaBinding Reference
Module defined in `lua/common/luaBinding.lua`. Core C++/Lua binding infrastructure implementing property getters/setters, inheritance chains, and SimObject field access for engine-bound classes.
luaProfiler Reference
Module defined in `lua/common/luaProfiler.lua`. A Lua code profiler that measures execution time and garbage generation for code sections, with optional peak detection and smoothed statistics.