[QUESTION] Adding Element doesn't work.

  • random_rickroll
    28th Jan 2021 Member 0 Permalink

    In the wiki, it says like this.

    Open ElementClasses.h in the editor of your choice (Visual Studio for windows users). ElementClasses.h is located under Source Files -> generated in the Solution Explorer. Double click it to open it up. You will see a file that should have a big list of #define PT_XXXX Y.

    However, mine looks like this.

    #ifndef ELEMENTCLASSES_H

    #define ELEMENTCLASSES_H

    #include <vector>

    #include "SimulationData.h"

    #include "Element.h"

    #define ELEMENT_NUMBERS_ENUMERATE

    #include "ElementNumbers.h"

    #undef ELEMENT_NUMBERS_ENUMERATE

    std::vector<Element> const &GetElements();

    #endif

    Any help?

     

  • jacob1
    28th Jan 2021 Developer 0 Permalink
    This guide appears to be out of date, we will update it later.

    Open up the file src/simulation/elements/meson.build instead, and add your element to the end of the list.

    Be wary of other problems in the guide, for example, anything "TPT-Directive" is outdated. If it gives an example file, it is also completely outdated and not valid.
  • random_rickroll
    28th Jan 2021 Member 0 Permalink

    @jacob1 (View Post)

     There's no such file, although there is one at src/simulation/meson.build

    but it doesn't have something like PT_XXXX Y.

    Edited once by Cheese_KR. Last: 28th Jan 2021
  • jacob1
    28th Jan 2021 Developer 0 Permalink
    @Cheese_KR (View Post)
    The file does exist, it's just hard to find in that folder because of how many element files there are

    https://github.com/The-Powder-Toy/The-Powder-Toy/blob/master/src/simulation/elements/meson.build
  • random_rickroll
    28th Jan 2021 Member 0 Permalink