Element limit?

  • hax4life
    27th May 2016 Member 0 Permalink

    Ive been creating on and on,but since short,every time i use:

    elements.element(elements.RADIO_PT_FT, elements.element(elements.DEFAULT_PT_STNE))

    or something equal i get:

    scripts/DoomsPackODeathstruction.lua:2466 bad argument #1 to 'element' (number expected, got nil)

    while it ran just fine before i inserted some new elements,any way to solve this issue/extent element limit?

    thanks for helping/taking your time

  • jacob1
    27th May 2016 Developer 0 Permalink
    There are only 255 element slots in TPT at the moment. After that, new elements won't fit, for a lot of reasons. The code was just designed that way. It would be possible to raise the limit (probably to 511 or 1023), it would just require going through and updating a lot of code.

    Currently there are 178 elements, which should leave room for 77 custom elements.
  • ChargedCreeper
    28th May 2016 Member 0 Permalink

    I assume the 255 limit is due to 0 representing the lack of an element, and the ID of elements being a single byte, thus 1 to 255 possible values for elements.

    Edited once by ChargedCreeper. Last: 28th May 2016
  • jacob1
    28th May 2016 Developer 0 Permalink
    @ChargedCreeper (View Post)
    Yes

    And the 178 is because CRMC is id 179, but there is an empty space at 146 for BRAN, back when it was a separate element. I think that is the only space.
  • hax4life
    3rd Jun 2016 Member 0 Permalink

    will the element limit ever rise? becouse untill then ill have to postpone my mod anyways,since i dont got the time to rise it myselves

  • jacob2
    3rd Jun 2016 Member 0 Permalink
    It might rise. But there are many things I really want to do with tpt but never do due to time constraints.
  • hax4life
    5th Jun 2016 Member 0 Permalink

    mm,ill try disabling life elements(non usefull ones) for more space,if i hit it then then ill postpone,lock it if ya want

  • jacob1
    5th Jun 2016 Developer 0 Permalink
    @hax4life (View Post)
    You can't disable default elements. Also, all of the LIFE elements share the same ID (78)
  • boxmein
    6th Jun 2016 Former Staff 0 Permalink
    @hax4life (View Post)
    To not get stuck behind TPT's updates, you could try making your own C++ mod that supports bigger element IDs. :P
  • hax4life
    28th Jun 2016 Member 0 Permalink

    just uploaded my last-for now update but yeah, @boxmein,dont got the time for that :p

    @jacob1,also just a dumb question but,why do life elements exit,in my optinion theyre a screen space waste,they really do annoy me,and PWHT(your element) is litterly like 100x better as an heater/cooler anyway

    id prefer it to be in normal TPT