LuaLibraries.wiki
changeset 1353 48e52d3c6c85
parent 1352 e504c2e2246d
child 1379 d3e693b12cb6
equal deleted inserted replaced
1352:e504c2e2246d 1353:48e52d3c6c85
     8 == Usage ==
     8 == Usage ==
     9 To use a library you only need to add this function call at the top of the script:
     9 To use a library you only need to add this function call at the top of the script:
    10 <code language="lua">HedgewarsScriptLoad("Scripts/<Library Name>.lua")</code>
    10 <code language="lua">HedgewarsScriptLoad("Scripts/<Library Name>.lua")</code>
    11 Where `<Library Name>` is replaced by the name.
    11 Where `<Library Name>` is replaced by the name.
    12 
    12 
    13 === Legacy `loadfile` ==
       
    14 *Note*: In ancient scripts, you might find this call instead:
    13 *Note*: In ancient scripts, you might find this call instead:
    15 <code language="lua">loadfile(GetDataPath() .. "Scripts/<Library Name>.lua")()</code>
    14 <code language="lua">loadfile(GetDataPath() .. "Scripts/<Library Name>.lua")()</code>
    16 This does not work with new Hedgewars versions anymore and causes the script to break. Use `HedgewarsScriptLoad` instead.
    15 This does not work with new Hedgewars versions anymore and causes the script to break. Use `HedgewarsScriptLoad` instead.
    17 
    16 
    18 == List of Lua libraries ==
    17 == List of Lua libraries ==