Depends.lua
Jump to navigation
Jump to search
| This is the archived page of the old LunaLua documentation The rest of LunaLua related articles in this wiki contain a lot of outdated documentation preserved for historical purposes and may be used with legacy versions of the LunaLua.
Please visit the SMBX2 Documentation Page to access the latest documentation for the LunaLua scripting system of the SMBX2 Project. Adding LunaLua contents into this Wiki is not advised. |
depends.lua is a small utility API, which resolves API dependency chains.
Installation
Copy the depends.lua file in the LuaScriptsLib folder.
How to use
It is very easy to use this API. Add the following line below all your loaded APIs:
API.load("depends").check({particles, paralX, textblox}, "my_level_api_dump.txt")
So it should look like this:
local particles = API.load("particles")
local paralX = API.load("paralX")
local textblox = API.load("textblox")
API.load("depends").check({particles, paralX, textblox}, "my_level_api_dump.txt")
This will check all APIs for dependent APIs and so on...
The result will then by written into a file. In this case in "my_level_api_dump.txt". The written file is located in the root folder of the game (Where smbx.exe is located!)
If everything went well, a message box should pop up with "Dumped!".
Note: Please be aware, that you should remove API.load("depends") before you bulid or release your Episode/Level. You don't want your players to dump the api dependencies, it is just for yourself with debugging!
The content of the written dump-file should something like this:
particles
rng
eventu
colliders
expandedDefines
vectr
paralX
graphX2
mathematX
vectr
vectr
graphX
mathematX
vectr
textblox
rng
graphX2
mathematX
vectr
vectr
graphX
mathematX
vectr
inputs2
pnpc
textblox
rng
graphX2
mathematX
vectr
vectr
graphX
mathematX
vectr
inputs2
pnpc
battleRoyal
rng
inputs
Required APIs list:
battleRoyal
colliders
eventu
expandedDefines
graphX
graphX2
inputs
inputs2
mathematX
paralX
particles
pnpc
rng
textblox
vectr