Add a comand

  • physics321
    17th Dec 2014 Member 0 Permalink

    Hi, I'm new to TPT moding, and am doing my first mod. How do do you add a console command? i was also wondering where the code that run autorun .lua is (completely unrelated).

    Thanks in advance.

  • Lord_Bowserinator
    17th Dec 2014 Member 0 Permalink

    In C++? The lua commands are in src/lua/LuaScriptInterface.h I think, along with the autorun.lua code (It's a small function somewhere in the middle)

     

    For normal console commands I think it's gui/console/consolecontroller.cpp

  • jacob1
    18th Dec 2014 Developer 0 Permalink
    Here is the autorun.lua code: The-Powder-Toy/blob/master/src/lua/LuaScriptInterface.cpp#L353

    Also what type of console command? Lua commands are in LuaScriptInterface.cpp/.h like @Lord_Borserinator said. Old console commands are in TPTScriptInterface.cpp I think.
  • Lord_Bowserinator
    18th Dec 2014 Member 0 Permalink

    Jacob1 yes it is in TPTScriptInterface.cpp, ignore what I said about console controller