Lua API reference¶
- Engine handlers reference
- User interface reference
- Game object reference
- Cell reference
- Built-in AI packages
- Built-in events
API packages provide functions that can be called by scripts. I.e. it is a script-to-engine interaction.
A package can be loaded with
It can not be overloaded even if there is a lua file with the same name.
The list of available packages is different for global and for local scripts.
Player scripts are local scripts that are attached to a player.
|Package||Can be used||Description|
Public interfaces of other scripts.
Defines utility functions and classes like 3D vectors,
that don’t depend on the game world.
Storage API. In particular can be used to store data
between game sessions.
Functions that are common for both global and local scripts
Functions for specific types of game objects.
Timers (implemented) and coroutine utils (not implemented)
|openmw.world||by global scripts||
Read-write access to the game world.
|openmw.self||by local scripts||
Full access to the object the script is attached to.
|openmw.nearby||by local scripts||
Read-only access to the nearest area of the game world.
|openmw.input||by player scripts||
|openmw.ui||by player scripts||
Controls user interface.
|openmw.camera||by player scripts||
|openmw.postprocessing||by player scripts||
Controls post-process shaders.
|openmw.debug||by player scripts||
Collection of debug utils.
openmw_aux.* are built-in libraries that are itself implemented in Lua. They can not do anything that is not possible with the basic API, they only make it more convenient.
Sources can be found in
resources/vfs/openmw_aux. In theory mods can override them, but it is not recommended.
|Built-in library||Can be used||Description|
Game time calendar
Timers and game time utils
|openmw_aux.ui||by player scripts||
User interface utils
Interfaces of built-in scripts¶
|Interface||Can be used||Description|
|AI||by local scripts||Control basic AI of NPCs and creatures.|
|Camera||by player scripts||
Allows to alter behavior of the built-in camera script
without overriding the script completely.
|Controls||by player scripts||
Allows to alter behavior of the built-in script
that handles player controls.
|Settings||by player and global scripts||Save, display and track changes of setting values.|
|MWUI||by player scripts||Morrowind-style UI templates.|