Efficient way to get state of particle?

  • creator_of_fail
    2nd May Member 0 Permalink

    I am working on some sort of element that checks whether the particle around it is a solid, liquid, etc. Currently I am confined to using menusection(doesn't work at all for BRAY for example), and would very much prefer a better way of doing this.

  • creator_of_fail
    6th May Member 0 Permalink

    I would like to know if there is some sort of workaround as well, maybe doing something with properties?

  • jacob1
    7th May Developer 1 Permalink
    The proper way to check state is with properties, yeah.

    Checking if something is a liquid:
    bit.band(elem.property(elem.DEFAULT_PT_WATR, "Properties"), elem.TYPE_LIQUID) ~= 0

    Checking if something is a powder:
    bit.band(elem.property(elem.DEFAULT_PT_DUST, "Properties"), elem.TYPE_PART) ~= 0

    The other 3 particle types are:
    TYPE_GAS
    TYPE_SOLID
    TYPE_ENERGY