Modding TPT

  • greymatter
    14th Jun 2013 Member 0 Permalink
    Okay, my previous thread about compiling tpt is done. I managed to compile TPT using visual C++ 2010 express.

    This is what i did till now:

    Configured vc++ according to wiki, and hit f7. After waiting for some time, the build finished, and i got a .exe TPT file in the build folder.

    Now i need to code elements. I read the wiki article on this, but it doesn't say how to add them. So i made this thread.
    Questions:

    1)When should i run generator.py?

    2)How do i add a coded element?



    Based on firefreak11's instructions, this is what i did till now:

    1)Opened elementclasses.h and added a #define for my element and also made a class at the end of the file.(copied and pasted DUST's class code and changed identifiers.)

    2)Opened elementclasses.cpp and added my element.

    3)Made a .cpp file in src\simulation\element with my element's name.

    4)Copied the code from DUST, changed the identifiers, and a few values here and there.
    5)Ran generator.py (Is randomly running it okay? because i ran it a few times when i got python, to see what would happen =P)
    6)Checked the .exe in the build folder. Not updated.
    Now how to proceed? Should i build solution again?
  • mniip
    14th Jun 2013 Developer 0 Permalink
    @greymatter (View Post)
    Don't edit elementcalsses manually
  • xetalim
    14th Jun 2013 Member 0 Permalink

    1)When should i run generator.py?


    when you recently changed something like elements

    does the editing of elementclasses automaticly.

     


    2)How do i add a coded element?


    start from scratch or copy a element that has sorta same properties and edit it

    i recommend boxmeins thing

  • greymatter
    14th Jun 2013 Member 0 Permalink
    @mniip (View Post)
    @xetalim (View Post)
    Elementclasses.h or elementclasses.cpp?
    Now should i just delete what i added?
  • xetalim
    14th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

     elementclasses.h i think

    well, if you added it right, dont delete it

    if you did it completely wrong, remove it

  • greymatter
    14th Jun 2013 Member 0 Permalink
    @xetalim (View Post)
    I added it right, or at least like how the remaining elements are added. How do i get the elements into the mod?
  • xetalim
    14th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

     what mod?

    powdersim2?

    just send it to firefreak i guess

  • mniip
    14th Jun 2013 Developer 0 Permalink
    @greymatter (View Post)
    run generator.py, it looks in your src/simulation/elements/ and generates elementclasses.cpp,elementclasses.h,toolclasses.cpp,toolclasses.h based on that
  • greymatter
    14th Jun 2013 Member 0 Permalink
    @xetalim (View Post)
    NONONO my mod. The mod of tpt that i hope to create. A completely new mod. And i want the element i coded to appear in the mod.
  • xetalim
    14th Jun 2013 Member 0 Permalink

    @greymatter (View Post)

     well, compile it

    and its in the mod.