# HG changeset patch # User almikes@aol.com # Date 1418657525 0 # Node ID 04b4b463bf3302f6dbd430dc50793f8a93b8e4f6 # Parent dc66ea78b36db36977cc03516815eb3f5ab4705b Add HedgewarsScriptLoad, warn about the old and rusty loadfile function. diff -r dc66ea78b36d -r 04b4b463bf33 LuaLibraries.wiki --- a/LuaLibraries.wiki Mon Dec 15 15:27:32 2014 +0000 +++ b/LuaLibraries.wiki Mon Dec 15 15:32:05 2014 +0000 @@ -5,11 +5,12 @@ 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: - -loadfile(GetDataPath() .. "Scripts/.lua")() - -Where is replaced by the name. Do not forget the "()" at the end as this initialises the file. +HedgewarsScriptLoad("Scripts/.lua") +Where `` is replaced by the name. +*Note*: In old scripts, you will find this line instead: +loadfile(GetDataPath() .. "Scripts/.lua")() +This does not work with new Hedgewars versions anymore and causes the script to break. You have to replace it with `HedgewarsScriptLoad`. = Locale =