New Element: ROCK (With .cpp Code)

  • RCAProduction
    2nd Aug 2020 Member 3 Permalink

    I suggest that we add a new element to the game. I have used it in my mod for about 4 years, and I know that it would be an improvement for many players and saves.

     

    Features:

     

    • Built-in randomized "noise" in color when created (non-deco) similar to QRTZ, CLST, CRMC, etc. using tmp2 (allows users to set uniform color as desired)
    • Melts at high temperature
    • Does not affect melting or freezing of STNE, making it backwards compatible
    • High pressure breaks it into STNE
    • Hardness of 70 and similar properties to CNCT make it ideal for bunkers and more realistic/strong terrain
    • DEST does not fling it all over the save
    • Easy implementation, only requires 3 lines of code in Simulation.cpp plus the ROCK.cpp file
    • Tested for 4+ years, no issues found!

     

     

     EDIT: Pull request made to the Git repository found here: https://github.com/The-Powder-Toy/The-Powder-Toy/pull/724

     

    The old code had to be updated to accomodate the current source being different than when ROCK was originally made. 

     

    Examples of ROCK, heated, and interacting with CNCT.

     

     

    Original code:

     

    ROCK.cpp is found raw here: https://raw.githubusercontent.com/RCAProduction/The-Alliance-Toy/master/src/simulation/elements/ROCK.cpp

     

    Or syntax highlighted here: https://github.com/RCAProduction/The-Alliance-Toy/blob/master/src/simulation/elements/ROCK.cpp

     

     

    In Simulation.cpp, only 4 line additions are required.

     

    Insert after line 2374 of the current Simulation.cpp last updated May 11, 2020:can_move[movingType][PT_ROCK] = 0;

     

    Insert after line 2776 of the current Simulation.cpp last updated May 11, 2020:

    if (y < ny && (pmap[y+1][x]) == PT_ROCK) //check below CNCT for ROCK
    return 0;
    }

     

     

     

    This is an element that would be used often and across a multitude of different saves. 

     

    Additions, suggestions, discussion are all welcome. 

    Edited 6 times by RCAProduction. Last: 3rd Aug 2020
  • nousernamefound
    3rd Aug 2020 Member 1 Permalink

    RCAProduction:

     

    • Does not affect melting or freezing of STNE, making it backwards compatible

     

     

     

    ok cool but why would it do that in the first place..? also r o c k. ngl sounds cool

    Edited once by nousernamefound. Last: 3rd Aug 2020
  • RCAProduction
    3rd Aug 2020 Member 0 Permalink

    @nousernamefound (View Post)

     In previous revisions about 5 years ago, the transition was meant to be STNE>LAVA>ROCK, with the idea that cooling lava would not produce stone but instead a solid rock body, but that would break saves. 

  • PangeaUltima
    5th Aug 2020 Member 0 Permalink

    @RCAProduction (View Post)

     One of reasons why i do not use this mod for powder toy

    I still want to go with vanilla elements

  • RCAProduction
    5th Aug 2020 Member 0 Permalink

    @PangeaUltima (View Post)

     This will make ROCK a vanilla element, part of the official release.

  • JustAPlayer
    16th Oct 2020 Member 0 Permalink

    ROCK is now in the latest TPT snapshot!!


    https://starcatcher.us/TPT/ <-- download the snapshot here, it also has platinum, silicon and custom GOL

    Edited 2 times by JustAPlayer. Last: 16th Oct 2020