User Tools

Site Tools


start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
start [2020/05/06 16:31] – [More info on:] maximestart [2020/05/06 18:31] maxime
Line 9: Line 9:
   * ** [[changelog|Changelog]] **   * ** [[changelog|Changelog]] **
   * ** [[migration|Migration Notes]] **   * ** [[migration|Migration Notes]] **
-  * ** [[guides|Guides]] **+  * ** [[guides|Community Guides]] **
  
 ===== More info on: ===== ===== More info on: =====
Line 57: Line 57:
  
 In order to include another LUA file, you can call the ''dofile'' function on your mod: In order to include another LUA file, you can call the ''dofile'' function on your mod:
-<code lua>+<code lua somescript.lua>
 myMod:dofile("anotherscript.lua") myMod:dofile("anotherscript.lua")
 </code> </code>
  
 This will execute the script ''anotherscript.lua'' from your mod folder. This will also pass the mod variable ''myMod'' to the script. So you will be able to access ''myMod'' from ''anotherscript.lua'' this way: This will execute the script ''anotherscript.lua'' from your mod folder. This will also pass the mod variable ''myMod'' to the script. So you will be able to access ''myMod'' from ''anotherscript.lua'' this way:
-<file lua anotherscript.lua>+<code lua anotherscript.lua>
 local myMod = ... -- retrieve arguments passed to the script local myMod = ... -- retrieve arguments passed to the script
  
 -- do stuff with myMod -- do stuff with myMod
 -- ... -- ...
-</file>+</code>
  
 In addition, you can pass any number of variable to the called script: In addition, you can pass any number of variable to the called script:
-<code lua>+<code lua somescript.lua>
 myMod:dofile("anotherscript.lua", 42, "A Super String", { 1, 4, 12 }) myMod:dofile("anotherscript.lua", 42, "A Super String", { 1, 4, 12 })
 </code> </code>
  
-<file lua anotherscript.lua>+<code lua anotherscript.lua>
 local myMod, anInteger, aString, anArray = ... -- retrieve arguments passed to the script local myMod, anInteger, aString, anArray = ... -- retrieve arguments passed to the script
-</file>+</code>
  
 ===== Enabling / Disabling a mod ===== ===== Enabling / Disabling a mod =====
start.txt · Last modified: 2022/03/30 10:53 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki