How do I set pressure in Lua?

  • Videogamer555
    14th Jan 2012 Member 0 Permalink
    I want to make a pixel add pressure to the 4x4 pixel block that it is in, but only do so under certain circumstances (sort of like VENT but with conditional if-then statements that govern its behavior). How do I control pressure values using Lua? Is it possible yet, or has this not been added to Lua in TPT?

    If it is possible, then I would be able to design my own explosives.
  • jacksonmj
    14th Jan 2012 Developer 0 Permalink
    There's https://powdertoy.co.uk/Wiki/W/Lua.html#tpt.set_pressure (but that's setting pressure, not adding it). Reading air pressure/velocity values hasn't been added yet.
  • MasterMind555
    14th Jan 2012 Member 0 Permalink

    jacksonmj:

    Reading air pressure/velocity values hasn't been added yet.

    Then tell me how can we have signs that shows the pressure ? That means that the code to get the pressure is already all made, you just need to make a lua fonction for it, which is terribly easy
  • Videogamer555
    14th Jan 2012 Member 0 Permalink
    Will adding/subtracting and reading of pressure be added to the Lua functions in a future version of TPT?
  • MasterMind555
    14th Jan 2012 Member 0 Permalink
    @Videogamer555 (View Post)
    To add pressure:

    tpt.setPressure(x,y) = tpt.getPressure(x,y) + 50.0f

    ( Not to be taken as working code, only a concept )

  • jacksonmj
    14th Jan 2012 Developer 0 Permalink
    @MasterMind555 (View Post)
    Signs have nothing to do with Lua. Yes it's easy, but no-one has bothered to do it yet (maybe because it's so easy, therefore boring, therefore easy to forgot about).

    @Videogamer555 (View Post)
    Yes, reading will probably be added at some point.
  • Videogamer555
    14th Jan 2012 Member 0 Permalink
    Wait how does "Yes, reading will probably be added at some point." work with Mastermind's comment "tpt.setPressure(x,y) = tpt.getPressure(x,y) + 50.0f"? And what's the difference between tpt.getPressure and tpt.get_pressure? Can someone explain this discrepency?
  • jacksonmj
    14th Jan 2012 Developer 0 Permalink
    @Videogamer555 (View Post)
    Neither tpt.getPressure nor tpt.get_pressure exist at the moment.
  • Videogamer555
    14th Jan 2012 Member 0 Permalink
    Is tpt.getPressure the internal C code that TPT uses to get the pressure data for the sign? Also would it be possible in the future for the developers to have TPT's pressure reading signs log their data to a file name (specify what variable you want it to read, and then specify the file name to record it to)? That would let one perform their own science lab "experiments" in TPT.
  • mniip
    14th Jan 2012 Developer 0 Permalink
    @Videogamer555 (View Post)
    mastermind just confused with capitals and underscores