Working on a mod, need some help!

  • RebMiami
    16th Jun 2017 Member 1 Permalink

    I wanted to make a mod, but I hit two problems:

    1. I can't find TPT's source code, only that of individual elements. Because of that, I cannot test my elements to make sure that they work.
    2. I can't figure out how to safely remove parts of elements' scripts without damaging/destroying their function.

    However, I AM still making some progress:

    Added:

    FIRT - Fire retardant. Extinguishes fire on contact., but breaks down at high temperatures. (WIP)

    PLSC - Strong plastic. Hard to burn and melts at high temperatures. (Hopefully done)

    MPLT - Molten plastic. Evaporates into poisonous gas at higher temperatures. (WIP)

    Planning to add:

    VPSC - Plastic vapors. Harmful to STKM. Cannot turn back into PLSC or MPLT. Flammable. (Help?)

    NTRI - Nitrogen triiodide. Extremely sensitive powder that explodes with any change in pressure.

    IODN - Heals STKM, but evaporates slightly below room temperature.

    IODV - Iodine vapor. Cools down into IODN slightly below room temperature.

    PAPR - Extremely flammable solid. Shreds at high pressures.

    SHPR - Shredded paper. Very flammable.

    CHRE - Chain reaction. Under pressure turns into DMG, turning more into DMG and so on.

    LCON - Liquid CONV.

    And more. I WILL NOT be taking suggestions, all I want is some help with this.

    Source code for PLSC (it is the only finished element in my mod SO FAR) to prove that I am not lying about my mod's existance:

    #include "simulation/Elements.h"
    //#TPT-Directive ElementClass Element_PLSC PT_PLSC 17
    Element_PLSC::Element_PLSC()
    {
    Identifier = "DEFAULT_PT_PLSC";
    Name = "PLSC";
    Colour = PIXPACK(0x93CFE2);
    MenuVisible = 1;
    MenuSection = SC_SOLIDS;
    Enabled = 1;

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

    Flammable = 1;
    Explosive = 0;
    Meltable = 0;
    Hardness = 80;

    Weight = 100;

    Temperature = R_TEMP+0.0f +273.15f;
    HeatConduct = 164;
    Description = "Plastic. Very hard to burn and melts at high temperatures.";

    Properties = TYPE_SOLID;

    LowPressure = IPL;
    LowPressureTransition = NT;
    HighPressure = IPH;
    HighPressureTransition = NT;
    LowTemperature = ITL;
    LowTemperatureTransition = NT;
    HighTemperature = 528.15f;
    HighTemperatureTransition = PT_MPLT;

    Update = NULL;
    Graphics = NULL;
    }

    Element_PLSC::~Element_PLSC() {}

    If you find any (stupid) mistakes in my code, please tell me so I can fix it.

  • QuanTech
    16th Jun 2017 Member 0 Permalink
    Edited once by QuanTech. Last: 16th Jun 2017
  • jacob1
    17th Jun 2017 Developer 0 Permalink
    There are many useful guides here that might help you: https://powdertoy.co.uk/Wiki/W/Main_Page.html#Powder_Toy_Development_Help

    If compiling on Windows, I strongly recommend the Visual Studio guide because it is easier and less prone to breakages. But I have no idea whether TPT compiles in the latest version of Visual Studio.
    Edited once by jacob1. Last: 17th Jun 2017
  • RebMiami
    17th Jun 2017 Member 0 Permalink

    Done, dug through and found elements folder, but how do you test-run your mod?

    Also found a few "super secret" elements that are probably WIP. I might do something with them.

    But seriously, how do you test-run your mod?

     

    Also jacob1 thanks, but it won't work for me. Maybe for some BIZR reason it just doesn't work with this computer. If it works for you... I don't know what to say. Just this computer. I am a bit confused to be honest.

     

    Started working on a new element, RSLT, which is rock salt. Same as normal salt, but is a solid and breaks into SALT at high pressures. FIRT is almost done, just need to add color and remove a certain part of the script. MPLT is not as close, really it's just recolored MWAX with a few different properties. Still working on it.

     

    I have done everything in the compiling guide, but typing in scons.py always yields the same result, even though I have followed the guide exactly:

    scons: *** No SConstruct file found.
    File "C:\Python27\Lib\site-packages\scons-2.4.1\SCons\Script\Main.py", line 923, in _main

    Edited 4 times by RebMiami. Last: 22nd Jun 2017
  • RebMiami
    23rd Jun 2017 Member 0 Permalink

    I started over completely on a different computer, made sure that I followed the instructions EXACTLY, and when I typed in cc I still got "bash: cc: command not found" Please help!

  • jacob2
    23rd Jun 2017 Member 0 Permalink
    You can ignore that step, keep following the guide
  • RebMiami
    23rd Jun 2017 Member 0 Permalink

    Oh ok

     

    Alright, I finished then process and I am 100% sure that I did everything right, and typing in scons.py still fails.

     

    Should I switch to Lua?

    Edited 2 times by RebMiami. Last: 23rd Jun 2017
  • QuanTech
    23rd Jun 2017 Member 0 Permalink

    @RebMiami (View Post)

     paste the output of scons.py on pastebin and give the pastebin link here please.

  • jacob1
    23rd Jun 2017 Developer 0 Permalink
    Also paste config.log, that's probably more important here

    Paste sites you can use (pick one): pastebin.com bpaste.net qp.mniip.com

    I would suggest switching to Lua though, it is a lot simpler. It's just less powerful and a little slower.
    Edited once by jacob1. Last: 23rd Jun 2017
  • RebMiami
    24th Jun 2017 Member 0 Permalink

    "Less powerful" meaning it can't run as well as actual reprogramming TPT?