Lua: Difference between revisions

From SigMod
Jump to navigation Jump to search
(Created page with "It is possible to embed Lua scripts into missions with LuaScript / LuaScriptFile keys. The scripts are parsed once when the game switches a mission, or when the map reset vot...")
 
mNo edit summary
Line 3: Line 3:
The scripts are parsed once when the game switches a mission, or when the map reset vote is called
The scripts are parsed once when the game switches a mission, or when the map reset vote is called


Lua programming guide is available at https://www.lua.org/pil/1.html and a quick reference at https://www.lua.org/manual/5.4/  
Lua programming guide is available at https://www.lua.org/pil/1.html and a quick reference at https://www.lua.org/manual/5.4/
 
Mission lua scripts are managed by [[Custom Entities#$script manager|$script_manager]] entity called popscript 


scripts/globals.lua is always parsed before mission scripts
scripts/globals.lua is always parsed before mission scripts

Revision as of 15:47, 21 May 2022

It is possible to embed Lua scripts into missions with LuaScript / LuaScriptFile keys.

The scripts are parsed once when the game switches a mission, or when the map reset vote is called

Lua programming guide is available at https://www.lua.org/pil/1.html and a quick reference at https://www.lua.org/manual/5.4/

Mission lua scripts are managed by $script_manager entity called popscript

scripts/globals.lua is always parsed before mission scripts

scripts/library.lua contains function definitons provided by the game library

Example popfile

globals.lua

library.lua