Editing Lua
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
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 | 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 | ||
Line 15: | Line 13: | ||
==== [https://github.com/rafradek/sigsegv-mvm/blob/master/scripts/mvm_bigrock_luademo.pop '''Example popfile'''] ==== | ==== [https://github.com/rafradek/sigsegv-mvm/blob/master/scripts/mvm_bigrock_luademo.pop '''Example popfile'''] ==== | ||
==== [https://github.com/rafradek/sigsegv-mvm/blob/master/ | ==== [https://github.com/rafradek/sigsegv-mvm/blob/master/src/lua/globals.lua globals.lua] ==== | ||
==== [https://github.com/rafradek/sigsegv-mvm/blob/master/ | ==== [https://github.com/rafradek/sigsegv-mvm/blob/master/src/lua/library.lua library.lua] ==== | ||
== Setting up in VS Code == | == Setting up in VS Code == | ||
Install Lua extension in marketplace. Place [https://github.com/rafradek/sigsegv-mvm/blob/master/ | Install Lua extension in marketplace. Place [https://github.com/rafradek/sigsegv-mvm/blob/master/src/lua/globals.lua globals.lua] and [https://github.com/rafradek/sigsegv-mvm/blob/master/src/lua/library.lua library.lua] in the directory where you want to create lua scripts, and load them in VS Code. This will enable autocompletion for your lua scripts | ||
== Profiling == | == Profiling == | ||
It is possible to measure script performance with sig_lua_prof_start and sig_lua_prof_end client commands | It is possible to measure script performance with sig_lua_prof_start and sig_lua_prof_end client commands |