Making a new prop

  • QuentinADay
    16th Jan 2015 Member 0 Permalink

    I want to make a PROP_INDESTRUCTIBLE like in jacob's Mod... I want to make an indestructable element but i made an exact copy of DMND (making the identifier DEFAULT_PT_DMND2 etc. etc. ...) but its very easily destroyable... not sure what to do

    Edited 2 times by QuentinADay. Last: 16th Jan 2015
  • wolfy1339
    16th Jan 2015 Member 1 Permalink
    Have you tried this elements.element(el, elements.element(elements.DEFAULT_PT_DMND)) ?
    I would suggest using http://boxmein.net/tptelements/#lua because it is very helpfull, and wil show you the basics of making an element.
  • boxmein
    16th Jan 2015 Former Staff 0 Permalink
    @QuentinADay (View Post)
    Easy enough!
    Just add a line here:
    https://github.com/simtr/The-Powder-Toy/blob/7d70c1f8d7278c4e9e47e9e817edcab8313eccb1/src/simulation/Elements.h#L33

    And then write your property specific behaviour somewhere you can access the elements[] from, like Renderer.cpp or Simulation.cpp.
  • QuentinADay
    16th Jan 2015 Member 0 Permalink

    I'm Really new to this, so i don't want to make a New PROP... lol. Is there a way to make an indestructable element without making a PROP_INDESTRUCTABLE?

    Edited once by QuentinADay. Last: 16th Jan 2015
  • Lord_Bowserinator
    17th Jan 2015 Member 0 Permalink

    Yes, do what current elements do. Just make them not melt/get destroyed by pressure and acid, then add it to the list of elements to not to be deleted in...

    AMTR.cpp

    SING.cpp

    VIRS.cpp

    DEST.cpp

    BOMB.cpp

    etc... so it won't be destroyed by those elements. Just add && PT_[your element name] or in some cases || instead of &&, just use the examples provided in those elements, for example DMND should be something like && PT_DMND && PT_CLNE or something...

  • QuentinADay
    17th Jan 2015 Member 0 Permalink

    @Lord_Bowserinator (View Post)

     Ohhhhhhh... yeah i forgot to do that... Thank you! lol