Using Modules

  • FeynmanLogomaker
    2nd Sep 2013 Member 0 Permalink

    How would I enable TPT to use a certain module?

     

    (Using the require function)

     

    In case you are willing to give step-by-step instructions, I'm trying to use lua-gdhttp://ittner.github.io/lua-gd/)

  • nucular
    2nd Sep 2013 Member 0 Permalink
    Umm.. put the gd bindings library(s) into the TPT folder, do
    require 'gd' or something like this and then use the functions available under gd.something?
  • FeynmanLogomaker
    2nd Sep 2013 Member 0 Permalink

    ...I tried that, I'll try again...

     

     

    --Edit: Never mind, I have it running. Could a moderator delete this?

    Edited once by FeynmanLogomaker. Last: 2nd Sep 2013
  • boxmein
    15th Sep 2013 Former Staff 0 Permalink
    For future people trying this:
    the way to do this is literally including the module in the working directory of the program, which is the folder the program executable is located.
    So if you have C:\Users\AwesomePerson\Desktop\TPT\
    and in there you have mymodule.lua, moduleuser.lua and Powder.exe,
    and moduleuser.lua has a require"mymodule" statement inside,
    using moduleuser.lua will use mymodule.lua as well.

    http://xkcd.com/979/
    Edited once by boxmein. Last: 15th Sep 2013