Flooder V2

  • TheAwesomeMutant
    16th Sep 2017 Member 2 Permalink

    Ever wanted to flood your worlds in zip? Well now you can!

    Introducing Flooder V2!

     

    But what is flooder?

     

    Flooder is an easy to use tool to flood your creations! It fills you save to a certain height, so that you can flood them in ease!

     

    But anyone can do that!

     

    What makes Flooder unique is that Flooder doesn't just flood your world, it prepares it for flooding too!

    Heres a step-by-step process of what goes on behind-the-scenes!

    First, it creates walls so your water doesnt go away!

    Second, it replaces elements that absorb water, like PLNT or SPNG, into a similar looking but different element!

    Third, it changes all water to DSTW, so that when it fills it with DSTW, it stays DSTW!

    Finally, it places the DSTW, and your world is now flooded!

     

    But how do I use Flooder?

     

    It's simple! Just open the console (~), and type 'flood()'!

    Enter your height, hit OK, and bam! Flooded!

    Or, you can type the height directly to skip the input! Just use 'flood(height)'!

     

    Ok, But where can I get this amazing tool?

     

    Easy! Either copy-paste it from here:

     

    function flood(height)
    if (height == nil) then
    height = tpt.input("Water Level", "")
    end

    sim.createLine(0, 378, 607, 378, 0, 0, elem.DEFAULT_PT_DMND)
    sim.createLine(0, 379, 607, 379, 0, 0, elem.DEFAULT_PT_DMND)
    sim.createLine(4, 379, 4, height, 0, 0, elem.DEFAULT_PT_DMND)
    sim.createLine(5, 379, 5, height, 0, 0, elem.DEFAULT_PT_DMND)
    sim.createLine(606, 379, 606, height, 0, 0, elem.DEFAULT_PT_DMND)
    sim.createLine(607, 379, 607, height, 0, 0, elem.DEFAULT_PT_DMND)

    tpt.set_property("type", "fuse", "vine")
    tpt.set_property("type", "fuse", "vine")
    tpt.set_property("type", "wood", "spng")
    tpt.set_property("type", "sand", "salt")

    tpt.set_property("type", "dstw", "watr")
    tpt.set_property("type", "dstw", "sltw")
    tpt.set_property("type", "dstw", "bubw")

    for h=height,379,1
    do
    sim.createLine(0, h, 607, h, 0, 0, elem.DEFAULT_PT_DSTW)
    end
    tpt.set_console(0)
    end

     

    Download it from here!

     

    Or get it on the script server/manager!

    clicky!

    Edited 5 times by TheAwesomeMutant. Last: 16th Sep 2017
  • jacob1
    16th Sep 2017 Developer 1 Permalink
    I approved the original script. But I didn't approve v2 because it doesn't work. You should test your scripts before submitting them and make sure they run and don't have any syntax errors. You can't use // comments in lua, use -- instead.

    Also, you're using sim.partChangeType improperly. That function is only for changing the type of a single particle. I think tpt.set_property can do what you want to change every single particle in the simulation.
  • TheAwesomeMutant
    16th Sep 2017 Member 0 Permalink

    it was working... now its not...

     

    (???)

     

    Edit: turns out i put the wrong version up, fixing it now...

    Edited once by TheAwesomeMutant. Last: 16th Sep 2017
  • jacob1
    16th Sep 2017 Developer 1 Permalink
  • Alexwall
    17th Sep 2017 Member 0 Permalink

    it doesnt seem to be chaning the elements, btw.