diff -r 81ec32569680 -r e504c2e2246d LuaLibraries.wiki --- a/LuaLibraries.wiki Wed May 02 22:54:25 2018 +0100 +++ b/LuaLibraries.wiki Wed May 02 22:55:34 2018 +0100 @@ -5,11 +5,13 @@ == Introduction == Libraries in scripts in Hedgewars are Lua files that are used by many scripts to add a common function, as an example the `Locale` library that allows scripts to translate text. The variables in these files are not exposed to the script using it but all the functions can be called. -To use a library you only need to add one row at the top of the script: +== Usage == +To use a library you only need to add this function call at the top of the script: HedgewarsScriptLoad("Scripts/.lua") Where `` is replaced by the name. -*Note*: In ancient scripts, you might find this line instead: +=== Legacy `loadfile` == +*Note*: In ancient scripts, you might find this call instead: loadfile(GetDataPath() .. "Scripts/.lua")() This does not work with new Hedgewars versions anymore and causes the script to break. Use `HedgewarsScriptLoad` instead.