tools.h is missing

  • jacob1
    20th May 2013 Developer 0 Permalink
    @firefreak11 (View Post)
    so you fixed it but then give up that easily? there is a tutorial here https://powdertoy.co.uk/Wiki/W/Coding-tutorial.html with an example .cpp file which has very nice descriptions, all you need to do is rename it to what you want your element to be. Also there is http://boxmein.web44.net/tptelements/ , which is almost the same as mine but maybe better.

    Adding elements is exactly the same as in c, but to access things like pv, photons, bmap, you need to just add a sim-> (sim->pv, sim->photons, sim->bmap).

    powder.c is renamed to Simulation.cpp and located in src/simulation/Simulation.cpp, and has basically the same functions (update_particles_i, create_part). If you need any other help I can give you that, I can also finish that guide I linked too on top sometime ...
  • firefreak11
    20th May 2013 Member 0 Permalink

    @jacob1 (View Post)

     is there a link to the old C setup for visual c++ anywhere?

  • jacob1
    20th May 2013 Developer 0 Permalink
    ... so you are still giving up after I posted tutorials, helpful links, other info, and said modding for c++ is exactly the same as modding for c but easier? (with elements at least ...)

    the old guide is gone because people should be moving on to c++ by now, but if you still want it, click "view history" and try to find a version before I edited it to update it.
  • firefreak11
    20th May 2013 Member 0 Permalink

    @jacob1 (View Post)

     Well the C one doesn't compile for me in Visual C and it never has so I will do the C++ one.

  • jacob1
    20th May 2013 Developer 0 Permalink
    You said you already got the c++ version to compile though
  • firefreak11
    20th May 2013 Member 0 Permalink

    @jacob1 (View Post)

     I did until I added an element and it broke but I fixed it and now I realize how much easier this is than the C....

    @jacob1 (View Post)

     Well it compiles with the new element, but there is an error in the game. My added element does not appear anywhere and ELEC is in there twice, and one of them works and the other, when spawned, just sits there.

  • jacob1
    20th May 2013 Developer 0 Permalink
    there is a line like this: //#TPT-Directive ElementClass Element_ACID PT_ACID 21

    Change all Element_ACID's to your element name (including in all the functions too), PT_ACID to your element name, and increase the id (21 here) to the next available id. 173 is currently the first free one, so start from there.

    You probably just never increased the id.
  • firefreak11
    21st May 2013 Member 0 Permalink

    @jacob1 (View Post)

     Its all fixed now. I also added a section on the wiki on how to add an element without running generator.py

  • jacob1
    21st May 2013 Developer 0 Permalink
    @firefreak11 (View Post)
    does generator.py not work or something? You kept constantly editing the wiki and I reverted the changes because the edit messages were getting annoying, and I needed to revert it anyway. I don't want people editing that manually since it causes problems, and is just a way of ignoring a bigger problem (and ignoring problems without solving them is never good)

    What happens when you run generator.py? If you made the element file incorrectly, it will use the wrong values and generate incorrectly, so you should show me the element file that's causing problems if there is one.
  • firefreak11
    21st May 2013 Member 0 Permalink

    @jacob1 (View Post)

     It works fine but I would rather do it the other way. I enjoy typing more code. So my wiki entry is gone? :( and yea, I couldnt get the wiki to format my code correctly.