OpenMW Lua becomes much easier once the architecture is clear.
If you are new to both Lua and OpenMW scripting, start with Zero to Hero. This section assumes you can already make a script run and now want to understand how OpenMW actually thinks.
Start with The OpenMW Lua Mental Model, then Script Contexts and Objects, Records, Types, and Cells. When something breaks, Debugging OpenMW Lua gives the investigation loop.
The purpose of this section is not to enumerate functions. It is to make the API map make sense before you need to search it.
The OpenMW Lua Mental Model
Engine, script, object, record, context, interface, event, and storage in one model.
Script Registration and Entry Points
Put context in the registration and architecture before the first require.
Script Contexts
Treat context as an architectural contract, not something to discover by crashing requires.
Objects, Records, Types, and Cells
The conceptual map behind GameObject handles and content records.
Events and Interfaces
Choose communication by ownership, direction, and lifetime rather than convenience.
Storage, Save State, and Lifecycle
Persistent state needs ownership, invalidation, and migration rules.
VFS and Paths
Treat OpenMW's virtual filesystem as the mod's filesystem contract, not the host OS.
UI — From Nothing to Something
Start with one visible element, then earn the architecture.
Debugging OpenMW Lua
Preserve the first useful failure, reduce the mechanism, and inspect the engine boundary instead of guessing.