Page 1 of 1

[Mod] Growth Limiter [20120828] [growth_limiter]

Posted: Fri Aug 24, 2012 12:24
by Ragnarok
If you have any problem with limitless trees, papyrus or any other living node growing to the sky this mod is exactly for you. It simple cut selected nodes located more than 7 nodes over the ground (by default). You can adjust settings in the init.lua file. No more hard work with axe and timber mod! Big thanks to cornernote for help with this code here.

WARNING! Use with care. If you have any construction made of trunks (or any other nodes specified in init.lua) more than 7 nodes over the ground this mod damage it!

Changes:
  • selected nodes are also removed properly over: stone, cobble, mossycobble, water_source, water_flowing, sand, sandstone, desert_sand, desert_stone and gravel
  • source code changes - thanks PilzAdam
License:
Sourcecode: WTFPL, http://sam.zoy.org/wtfpl/

Mod dependencies: default

ZIP: http://db.tt/XlxCPhrZ
MD5: http://db.tt/B566WeWT be9bf85306e34ded16ff105601842f81

Screenshots:

BEFORE:

Image

AFTER:

Image

Old versions:

Posted: Fri Aug 24, 2012 12:32
by TheLoLMan
LOL :D

Posted: Mon Aug 27, 2012 20:36
by Ragnarok
Updated. Can anybody give me a tip how do this part using "for" loop? table?

Code: Select all

if (current_node == "default:dirt"
 or current_node == "default:dirt_with_grass"
 or current_node == "default:stone"
 or current_node == "default:cobble"
 or current_node == "default:mossycobble"
 or current_node == "default:water_source"
 or current_node == "default:water_flowing"
 or current_node == "default:sand"
 or current_node == "default:sandstone"
 or current_node == "default:desert_sand"
 or current_node == "default:desert_stone") then
    return
end

Posted: Mon Aug 27, 2012 21:36
by PilzAdam
Ragnarok wrote:Updated. Can anybody give me a tip how do this part using "for" loop? table?

Code: Select all

if (current_node == "default:dirt"
 or current_node == "default:dirt_with_grass"
 or current_node == "default:stone"
 or current_node == "default:cobble"
 or current_node == "default:mossycobble"
 or current_node == "default:water_source"
 or current_node == "default:water_flowing"
 or current_node == "default:sand"
 or current_node == "default:sandstone"
 or current_node == "default:desert_sand"
 or current_node == "default:desert_stone") then
    return
end

Code: Select all

local nodes = {"default:stone", "add the other nodes", "another node"}
for _,nodename in ipairs(nodes) do
    if current_node == nodename then
        [code here]
        break
    end
end

Posted: Mon Aug 27, 2012 21:48
by Ragnarok
Thanks :) Update soon.