[Mod] Growth Limiter [20120828] [growth_limiter]

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

[Mod] Growth Limiter [20120828] [growth_limiter]

by Ragnarok » Fri Aug 24, 2012 12:24

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:

Last edited by Ragnarok on Tue Aug 28, 2012 13:07, edited 1 time in total.
 

TheLoLMan
Member
 
Posts: 190
Joined: Sat Jun 16, 2012 13:43

by TheLoLMan » Fri Aug 24, 2012 12:32

LOL :D
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Mon Aug 27, 2012 20:36

Updated. Can anybody give me a tip how do this part using "for" loop? table?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Aug 27, 2012 21:36

Ragnarok wrote:Updated. Can anybody give me a tip how do this part using "for" loop? table?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
 

User avatar
Ragnarok
Member
 
Posts: 213
Joined: Thu Mar 22, 2012 12:56

by Ragnarok » Mon Aug 27, 2012 21:48

Thanks :) Update soon.
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 41 guests

cron