Getting the ID of Lua elements

  • DanielsRevenge
    5th Sep 2021 Member 0 Permalink

    In Lua, I am trying to make it so that Seed (a lua element) turns into a mutant seed when it is near a ALPH (lua element).

     

    But tpt.el.alph.id doesn't do anything, and I know that lua IDs are variable.

     

    What do I do here?

  • LBPHacker
    5th Sep 2021 Developer 0 Permalink
    Forget about tpt.*, as a first step. Use the modern API. Any element's ID is available in the elem(ents) table as elem.[group]_PT_[name], ALPH's would be elem.???_PT_ALPH, ??? being whatever you passed as the first argument to elem.allocate.
  • DanielsRevenge
    5th Sep 2021 Member 0 Permalink

    Thank you.

     

    So in this case it would be elem.PLUS_PT_ALPH since ALPH is from PowderPlus.