fill emptiness with water

  • TheAwesomeMutant
    16th Sep 2017 Member 0 Permalink
    I would like to fill all the empty space below a certain point with water. The trouble i'm having is filling the empty space with water. It doesn't seem possible to select/change the property of nothing. Is there a way to do this?
  • jacob1
    16th Sep 2017 Developer 0 Permalink
    use sim.partCreate(i, x, y, type)

    for i, use -1. This means "create if empty space". There are other options, -3 creates it even if it's not empty, and a number >= 0 will delete the particle with that ID and give it to yours.
    Edited once by jacob1. Last: 16th Sep 2017
  • TheAwesomeMutant
    16th Sep 2017 Member 0 Permalink

    Thanks! Is there a way to make this fill/lines or do I have to stick with for loops?

  • jacob1
    16th Sep 2017 Developer 0 Permalink
    sim.floodParts(100, 100, elem.DEFAULT_PT_DUST)
    Would flood fill DUST at 100, 100, just like normal flood fill does.

    sim.createLine(100, 100, 200, 200, 0, 0, elem.DEFAULT_PT_OIL)
    Would create a line from 100, 100, with brush with 0x0 (smallest brush), of OIL

    See the wiki for more functions: https://powdertoy.co.uk/Wiki/W/Lua_API:Simulation.html
  • TheAwesomeMutant
    16th Sep 2017 Member 0 Permalink

    Ok thanks its working!