Modding TPT

  • cyberdragon
    14th Jun 2013 Member 0 Permalink
    This post has been removed by jacob1: lies. The only possible reason you wouldn't use generator.py is if you don't have python, but you really do need it. Not using it causes a ton of problems if you mess up
  • boxmein
    14th Jun 2013 Former Staff 0 Permalink
    @greymatter (View Post)
    Run generator.py when you add a new element. It regenerates element ID's and their class definitions and their PT_XXXX symbols.
    For how to add a coded element, first...
    http://boxmein.x10.mx/tptelements/
    Copy/paste the contents of this into a new code file which would be named ".cpp" like BRAY.cpp or DERP.cpp.
    Put the file into the folder The-Powder-Toy/src/simulation/elements/, next to all the other elements.
    And then re-run generator.py.
  • mniip
    14th Jun 2013 Developer 0 Permalink
    @cyberdragon (View Post)
    You didn't add the directives
  • greymatter
    15th Jun 2013 Member 0 Permalink
    @boxmein (View Post)
    Okay, now i deleted what i added to elementclasses.h and elementclasses.cpp. I re-ran generator.py, and opened the .exe in the build folder. No element found. I checked elementclasses.h and elementclasses.cpp and found that the element has been added. But it's not in the mod. This is the code of the element(copied from dust with some editing, and named BGLD(broken gold):

    #include "simulation/Elements.h"
    //#TPT-Directive ElementClass Element_BGLD PT_BGLD 170
    Element_BGLD::Element_BGLD()
    {
    Identifier = "DEFAULT_PT_BGLD";
    Name = "BGLD";
    Colour = PIXPACK(0xFFE0A0);
    MenuVisible = 1;
    MenuSection = SC_POWDERS;
    Enabled = 1;

    Advection = 0.0f;
    AirDrag = 0.00f * CFDS;
    AirLoss = 0.00f;
    Loss = 0.0f;
    Collision = 0.0f;
    Gravity = 1f;
    Diffusion = 0.00f;
    HotAir = 0.000f * CFDS;
    Falldown = 1;

    Flammable = 0;
    Explosive = 0;
    Meltable = 0;
    Hardness = 0;

    Weight = 175;

    Temperature = R_TEMP+0.0f +273.15f;
    HeatConduct = 80;
    Description = "Broken gold.See GOLD for more info";

    State = ST_SOLID;
    Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC;

    LowPressure = IPL;
    LowPressureTransition = NT;
    HighPressure = IPH;
    HighPressureTransition = NT;
    LowTemperature = ITL;
    LowTemperatureTransition = NT;
    HighTemperature = ITH;
    HighTemperatureTransition = NT;

    Update = NULL;
    Graphics = NULL;
    }

    Element_BGLD::~Element_BGLD() {}


    Help...
  • xetalim
    15th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

    Element_BGLD PT_BGLD 170

    Are you sure its ID 170?

    In the latest source TPT has 172 ID's

    Change

    Element_BGLD PT_BGLD 170

    to Element_BGLD PT_BGLD 173

  • greymatter
    15th Jun 2013 Member 0 Permalink
    @xetalim (View Post)
    It's not the latest source. I can't access Github so mniip updated the source of the version of TPT few months back. I have only that version :(

    But it's not too old, as it has PSTN, FRME etc, which are recent elements.
    @mniip:can you upload the the new version?
  • xetalim
    15th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

     what?

    you cant access github?

  • greymatter
    15th Jun 2013 Member 0 Permalink
    @xetalim (View Post)
    My modem cannot load certain sites. Now can anyone give me a solution to the problem?
  • xetalim
    15th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

     hmm, i got an idea, i'll send you the source

    here you go, download and extract

    https://mega.co.nz/#!YEtnAJSR!KFdWbUzGNIiVl49khXmbYicqHttc9HruvHXxaIms8B0


  • greymatter
    15th Jun 2013 Member 0 Permalink
    @xetalim (View Post)
    I can't access that too (-_-) I'll ask mniip to do it.

    PROBLEM:
    i coded an element called DERP, and ran generator.py. Nothing was added to elementclasses. I added them manually, and opened the mod. Nothing.
    Okay, this is driving me mad.
    Can anyone find a proper solution?
    @anyone who has a mod:
    How did you add elements to the mod? did you just write the code and ran generator.py, or did something else?