Page 1 of 1

LUA function: get_ground_level

PostPosted: Sat Jan 21, 2012 14:18
by inkelyad
github link

It shoul be useful for 'More Ores' and 'Gemstones' mods.

PostPosted: Sat Feb 18, 2012 15:53
by Death Dealer
Very cheap yo, most people are not looking to cheat the game.

PostPosted: Sat Feb 18, 2012 20:40
by jn
How is this related to cheating?

PostPosted: Sat Feb 18, 2012 21:59
by Death Dealer
What's this lua Funtion do? Teleport to ground level?

PostPosted: Sat Feb 18, 2012 22:10
by IPushButton2653
It makes ores stay below the Y coordinate of 0. So no more gemstones where dirt should be :P

PostPosted: Sun Feb 19, 2012 01:09
by Gatharoth
IPushButton2653 wrote:It makes ores stay below the Y coordinate of 0. So no more gemstones where dirt should be :P


Mmm... this can be a problem because of the fact of mountains that are way above Y=0. So a mountain, that would normally have a few or a lot gemstones/ores, would no longer have them.

Although this could be good, or again, it could not be. Its all situational.

While yes, this makes it generally more realistic, in other cases, such as the mountain stated above; It would make it unrealistic.

Since both cases will happen on a server, I cannot really justify using it.

PostPosted: Sun Feb 19, 2012 03:32
by IPushButton2653
It just dawned on me, but couldn't this also be used to make an ore-like material, for say, fossils, appear under a certain depth?

PostPosted: Sun Feb 19, 2012 05:54
by Gatharoth
IPushButton2653 wrote:It just dawned on me, but couldn't this also be used to make an ore-like material, for say, fossils, appear under a certain depth?


In theory, yes. By logic, if you can force ores to only show up when Y<0, then certainly you can make fossils appear when Y<X.

Only way to be 100% sure is to test it :D

PostPosted: Sun Feb 19, 2012 07:38
by Death Dealer
Oooooo. Interesting....

PostPosted: Sun Feb 19, 2012 12:18
by sdzen
well if you think about it gemstones should be deep in the ground anyway so their somewhat hard to get to

PostPosted: Sun Feb 19, 2012 14:33
by inkelyad
Gatharoth wrote:Mmm... this can be a problem because of the fact of mountains that are way above Y=0. So a mountain, that would normally have a few or a lot gemstones/ores, would no longer have them.

My function solves exactly this problem. It return ground level. You want to know mountains height, right?

sdzen wrote:well if you think about it gemstones should be deep in the ground anyway so their somewhat hard to get to

Yes, they should. Here is how I do it: https://github.com/inkelyad/zlovespancakes-minetest-mods/blob/use_get_ground_level/gemstones/init.lua

PostPosted: Sun Feb 19, 2012 23:57
by IPushButton2653
Unfortunately, I can't seem to compile on my computer. But if anyone has a windows version with this in it, I'd be thankful if they'd share it with me.

PostPosted: Sun Mar 25, 2012 09:36
by jn
What is the exact error message you get?