Cod3xDocs
api

Built-In Interfaces

Built-in interface availability and what the concept means architecturally.

openmw.interfaces is a registry of script-facing capabilities published by OpenMW's built-in scripts and mods.

Do not confuse an interface with a C++ class or a generic language “interface” keyword. In OpenMW Lua, the important concept is a named script contract available in specific contexts.

Cod3x currently models built-in availability approximately as:

InterfaceContext
Activationglobal
AnimationControllerlocal, player
AIlocal
Cameraplayer
Combatglobal, local, player
Crimesglobal
Controlsplayer
GamepadControlsplayer
ItemUsageglobal
MWUIplayer, menu
Projectilesglobal
Settingsglobal, player, menu
SkillProgressionplayer
SpellCastingglobal, local, player
UIplayer

The exact fields and signatures live in content/cod3x/openmw/interfaces/*.lua.

Mod interfaces

A mod can publish its own interface by returning it from the script registration.

Treat that table as public API:

  • version deliberately;
  • type it;
  • document ownership;
  • avoid exposing internal mutable tables accidentally;
  • make required/optional dependencies clear.

H3 and S3maphore are useful examples of interface-driven reusable infrastructure.