Depends.lua

From Moondust Wiki
Revision as of 08:17, 16 June 2017 by Yingchun Soul (talk | contribs)
Jump to navigation Jump to search

Download Latest Version

Warning: This API only used for debug stuff! NEVER use on normal purpose!!!!!!

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!".

Please be aware, that you should remove API.load("depends") before you release your Episode/Level. You don't want your players to dump the api dependencies, it is just for yourself!

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