Feynman's Mod

  • FeynmanLogomaker
    November 2014 Member 15 Permalink

    Feynman's Mod


    So far, I've only just started work on this, but it will be getting a lot more elements and features in the near future.


    The changelog and download links can be found here.

    You can also leave suggestions there - suggestions are very welcome, especially this early in developnent.


    Major Features:

    TPTNet server capabilities - you can switch between the official server and TPTNet through a button in the Options panel, without the need for two separate programs as in the official build

    LuaJIT integration - all Lua code will run 100%-500% faster


    TPTMP/Script Manager integration


    Command Signs:

      Format: {l|--[[Lua code here]]}

      When clicked, they run whatever code is inside them. They are sandboxed - not all functions are available

      inside a command sign - for security reasons.


    Text Plotting API:

       Usage: sim.plottext(x, y, "text"[, r, g, b, a])

          Plots text in the standard TPT font, with deco on DMND.


    Other Features:


    graphics.noise(x[, y[, z]]): An implementation of Perlin/Fractal noise, maybe useful, maybe not.


    BDST: Binary data storage

      Sparked with NSCN: reads 2^(part->tmp) particles in direction of spark, saves data to part->ctype

        For example, this arrangement - 

        [N][B][P][  ][P][P]

        - in which [N] = sparked NSCN, [B] = BDST (tmp=2), [P] = any particle, [  ] = empty space - 

        would set the BDST's ctype to 11 (or 0x0000000B).


      Sparked with PSCN: Outputs data to wifi channels from part->temp / 100 to part->temp / 100 + 2^(part->tmp)

        For example, the aforementioned arrangement, with the temp of [B] = 1000, would send a signal to WIFI

        on channels 10, 12 and 13 when sparked with PSCN.



    Download page: here







    Basic timing:



    Edited 34 times by FeynmanLogomaker, jacob1. Last: March 2015
  • mecha-man
    November 2014 Member 0 Permalink

    You got the links mixed up.

    Also when I try to run it it says:

    The program can't start because libgcc_s_dw2-1.dll is missing from your computer.

  • bowserinator
    November 2014 Member 0 Permalink

    Add CMRC from my mod to it, will post source later...


    #include "simulation/Elements.h"
    //#TPT-Directive ElementClass Element_CERM PT_CERM 181
        Identifier = "DEFAULT_PT_CERM";
        Name = "CMRC";
        Colour = PIXPACK(0xFFFCEB);
        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 = 0;
        Explosive = 0;
        Meltable = 0;
        Hardness = 1;
        Weight = 100;
        Temperature = R_TEMP+0.0f    +273.15f;
        HeatConduct = 225;
        Description = "Ceramics. Super tough solid.";
        State = ST_SOLID;
        LowPressure = -30.0f;
        LowPressureTransition = PT_CLST;
        HighPressure = NT;
        HighPressureTransition = ITL;
        LowTemperature = ITL;
        LowTemperatureTransition = NT;
        HighTemperature = NT;
        HighTemperatureTransition = ITL;
        Update = &Element_CERM::update;
        Graphics = &Element_CERM::graphics;

    float meltpoint = 4273.15f;

    //#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS)
    int Element_CERM::update(UPDATE_FUNC_ARGS){
        int r, rx, ry;
        for (rx = -1; rx < 2; rx++){
            for (ry = -1; ry < 2; ry++){
                if (BOUNDS_CHECK)
                    r = pmap[y + ry][x + rx];
                    if (!r || (r & 0xFF) == PT_CERM){
                        meltpoint = 2573.15f+sim->pv[y / CELL][x / CELL]*10;
                        if (parts[i].temp >= meltpoint){   
                            parts[i].life = parts[i].life + 1;
                            if (parts[i].life > 1000){
                                parts[i].life = 0;
                                sim->part_change_type(i, parts[i].x, parts[i].y, PT_LAVA);
                        r = sim->photons[y + ry][x + rx];
                    if (!r){
                    if (parts[r >> 8].type == PT_PROT){  //Delete PROT
                        sim->part_change_type(r >> 8, parts[r >> 8].x, parts[r >> 8].y, PT_NONE);
                    if (parts[r >> 8].type == PT_VIRS | parts[r >> 8].type == PT_VRSS){  //Immune to VRSS and VIRS
                        if (parts[r >> 8].tmp2 == PT_CERM){
                            sim->part_change_type(r>>8, parts[r>>8].x, parts[r>>8].y, PT_CERM);
        return 0;


    @mecha-man (View Post) Works fine for me

    Yeah the links are reversed

    Edited 3 times by bowserinator. Last: November 2014
  • FeynmanLogomaker
    November 2014 Member 0 Permalink

    You need dllpack.zip; a quick forum search should find it.

    And sure, I'll add that element.

  • jacob1
    November 2014 Developer 0 Permalink
    If you mean boxmein's thing it seems it was deleted. Try mine: https://dl.dropboxusercontent.com/u/43784416/PowderToy/dlls.zip

    (you only need that single dll probably)
  • wolfy1339
    November 2014 Member 0 Permalink
    Please use --static when compiling on SCons, instead of including all of those DLL's
    Edited once by wolfy1339. Last: November 2014
  • FeynmanLogomaker
    November 2014 Member 0 Permalink

    @wolfy1339 (View Post)

     Good idea, thanks.


    By the way, I'm trying to write it to include a few scripts automatically (like in Jacob1's mod, but with my own modifications), but it's not working very well, so I probably won't get any more releases out until next weekend.

    Edited once by FeynmanLogomaker. Last: November 2014
  • wolfy1339
    November 2014 Member 0 Permalink
    If you need linux builds,just use my server, it's set up to compile (at least o think so)
  • FeynmanLogomaker
    November 2014 Member 0 Permalink

    @wolfy1339 (View Post)

     Ok, I'll do that (probably on Wednesday). Is it alright if I also use it for the update server, or would that be asking too much?

    @jacob1 (View Post)

     Thanks, that should help a lot!


    By the way, does anyone know where the code is for spark signs? I have some code for Lua command signs but I can't find where to put it.

    Edited once by FeynmanLogomaker. Last: November 2014