Lua:Environments: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
→Environments: some source links
Flozi (talk | contribs)
→Environments: underp links
 
Line 2: Line 2:
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.
=== LuaMenu ===  
=== LuaMenu ===  
Source: {{sourcelink|file=Lua/LuaMenu.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaMenu.cpp}}


Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.
=== LuaParser ===
=== LuaParser ===
Source: {{sourcelink|file=Lua/LuaParser.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaParser.cpp}}


Minimal environment used to parse and load definition files.
Minimal environment used to parse and load definition files.
=== LuaIntro ===  
=== LuaIntro ===  
Source: {{sourcelink|file=Lua/LuaIntro.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaIntro.cpp}}


Introduced in 95.0, to allow visual customisation of the loading process.
Introduced in 95.0, to allow visual customisation of the loading process.
=== LuaRules (synced) ===
=== LuaRules (synced) ===
Source: {{sourcelink|file=Lua/LuaHandle.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaHandle.cpp}}


Source: {{sourcelink|file=Lua/LuaHandleSynced.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaHandleSynced.cpp#L305}}


The main environment for synced game-controlling mechanics ("gadgets").
The main environment for synced game-controlling mechanics ("gadgets").
=== LuaRules (unsynced) ===
=== LuaRules (unsynced) ===
Source: {{sourcelink|file=Lua/LuaHandle.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaHandle.cpp}}
 
Source: {{sourcelink|file=rts/Lua/LuaHandleSynced.cpp#L57}}


The main environment for unsynced game effects, rendering, UI etc. ("gadgets")
The main environment for unsynced game effects, rendering, UI etc. ("gadgets")
=== LuaGaia (synced) ===
=== LuaGaia (synced) ===
Source: {{sourcelink|file=Lua/LuaGaia.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaGaia.cpp}}


As LuaRules (synced) but for maps.
As LuaRules (synced) but for maps.
=== LuaGaia (unsynced) ===
=== LuaGaia (unsynced) ===
Source: {{sourcelink|file=Lua/LuaGaia.cpp}}
Source: {{sourcelink|file=rts/Lua/LuaGaia.cpp}}


As LuaRules (unsynced) but for maps.
As LuaRules (unsynced) but for maps.

Latest revision as of 02:31, 26 December 2017

Environments

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

LuaMenu

Source: rts/Lua/LuaMenu.cpp

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

LuaParser

Source: rts/Lua/LuaParser.cpp

Minimal environment used to parse and load definition files.

LuaIntro

Source: rts/Lua/LuaIntro.cpp

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

LuaRules (synced)

Source: rts/Lua/LuaHandle.cpp

Source: rts/Lua/LuaHandleSynced.cpp#L305

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

LuaRules (unsynced)

Source: rts/Lua/LuaHandle.cpp

Source: rts/Lua/LuaHandleSynced.cpp#L57

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

LuaGaia (synced)

Source: rts/Lua/LuaGaia.cpp

As LuaRules (synced) but for maps.

LuaGaia (unsynced)

Source: rts/Lua/LuaGaia.cpp

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.

LuaMenu LuaIntro LuaParser LuaRules/Gaia
(synced)
LuaRules/Gaia
(unsynced)
LuaUI
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