Lua:Environments

From Spring
Revision as of 16:26, 22 December 2017 by Flozi (talk | contribs) (Move lua interfaces table and give further details on the purpose of each environment)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Environments

Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.

LuaMenu

Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.

LuaParser

Minimal environment used to parse and load definition files.

LuaIntro

Introduced in 95.0, to allow visual customisation of the loading process.

LuaRules (synced)

The main environment for synced game-controlling mechanics ("gadgets").

LuaRules (unsynced)

The main environment for unsynced game effects, rendering, UI etc. ("gadgets")

LuaGaia (synced)

As LuaRules (synced) but for maps.

LuaGaia (unsynced)

As LuaRules (unsynced) but for maps.

LuaUI

The main environment for toggleable UI elements and controls ("widgets").

Interfaces

The following table demonstrates which interfaces are available to each environment.

LuaUI LuaRules
(unsynced)
LuaRules
(synced)
LuaMenu
Lua_ConstGame + + + -
Lua_ConstEngine + + + +
Lua_ConstPlatform + + + +
Lua_UnitDefs + + + -
Lua_WeaponDefs + + + -
Lua_FeatureDefs + + + -
Lua_ConstCOB - - + -
Lua_CMDs + + + -
Lua_UnsyncedRead + + - +***
Lua_UnsyncedCtrl + + + +***
Lua_SyncedRead +** + + -
Lua_SyncedCtrl - - + -
Lua_MoveCtrl - - + -
Lua_PathFinder + + + -
Lua_OpenGL_Api + + - +***
Lua_GLSL_Api + + - +***
Lua_FBO_and_RBO + + - +***
Lua_UnitRendering - + - -
Lua_Fonts + + - +
Lua_ConstGL + + - +
Lua_VFS + + +* +
Lua_Scream + + - +
Lua_BitOps + + + -
Lua_MathExtra + + + -
Lua_Socket + + + +


* only VFS.ZIP_ONLY
** with special LOS handling and decoy unit handling
*** stripped down environment with certain functions removed