Help with a lua script project

  • vertigo
    28th Jun 2012 Member 0 Permalink

    I want to make a lua script that detects when there is a sign on the current save that says: t:(then the #) and another but for pressure. Then it will get the number, and make a graph out of 1-frame particles. A graph on each side where the zoom tool usually appears. The first one will measure pressure, then the second will measure heat. It will only be shown in debug mode, and the sign-input can be toggled or switched to the particle your mouse is currently hovering above. The graph will be sort of a timelapse graph showing how the heat rises and falls, same with the pressure graph. Then there will be a new element replacing "BRAN" that could also be used as the input. I only need help with knowing the command to get the inputs. Everything else i can do, thanks in advance. ~Vertigo

  • jacob1
    28th Jun 2012 Developer 0 Permalink
    @vertigo (View Post)
    There is no command to get sign text, and there also isn't one to get pressure unfortunately (only set pressure). A command to get pressure should definitely be added, and a way to make / edit signs would also be useful.

    Also, I wouldn't recommend replacing BRAN, it's the only old GOL element left. When another element is added, it will be gone and your script won't work. WIND was also removed, which shocked me, because i thought it would end up like EQVE, which is another useful elements to base lua elements off of. (Also, jacksonmj purposely replaced it instead of BRAN when creating EMBR)
  • vertigo
    28th Jun 2012 Member 0 Permalink

    @jacob1 (View Post)

     Thanks for the feedback, and i never knew that wind was removed. By the way, what was EQVE's initial purpose? I would love to know that. Also, why not leave all the empty slots as /*free*/ elements named elm1, 2, 3, 4, so on? It would help modders, and wont do any damage to the game at all.

  • jacob1
    28th Jun 2012 Developer 0 Permalink
    @vertigo (View Post)
    EQVE was a moving solids test, it stands for equal velocity. Every frame, all of their velocities were set to be equal, but that failed completely so the code was removed. I'm not sure if the code was ever even put on github, so I don't know why it would be left in the game. (For EQVE to work, their x and y coordinates would have also needed to be set every frame)

    Also there is a limit to how many elements can be put in the game. Currently, it's 221, but it can be raised easily to 255, but then raising it even more would be hard to do. Those were removed so that more elements could be added without needing to raise the limit. I think a way does need to be added to make custom lua elements now that all of the elements marked /*free*/ are gone, I might try it soon, or just raise PT_NUM to 221. Right now, I think there are about 160-170 elements.
  • vertigo
    28th Jun 2012 Member 0 Permalink

    @jacob1 (View Post)

     Thanks again. Now that my project is impossible, i will leave it for later when those things are implemented. I will now attempt to make EQVE server its original purpose. Moving solids. Thanks, ~Vertigo.

  • boxmein
    29th Jun 2012 Former Staff 0 Permalink
    @jacob1 (View Post)
    After 255 would require a serious change in the way the game works, they wanted to make it 2-byte some time ago..

    ---
    Making it bigger would require immense effort.
    You have an element grid.

    - - - o o o - - - - - - o -
    - - - - - - - o - - o - - q -
    - - - q q q q - i - i - i - -

    and so on.
    The computer knows which particle is which by its code, which is kept in the memory as 1 byte. (See memory architecture) 1 byte has 255 different values, that limits it to 255.
    They wanted to add another byte, but for that they need to make the program know that it's two bytes instead - the program will consume more memory and be slower. Plus, a lot of the logic the code uses is done by implying that it's gonna be a single byte put in. It'd be a huge re-write.
    -Anyhow, that wasn't relevant at all. :D-