rubenwardy wrote:You don't touch the settings, you just have to request an insecure environment. It means that your mod and your mod only can access insecure functions like require(). The alternative is having an external program download it, but that's more complicated for the end user than requesting an environment. Then again, they'd need to use luarocks to get luasockets....
bobomb wrote:i have posted this mod as a work in progress: https://forum.minetest.net/viewtopic.php?f=9&t=12666
function get_pixel2(x,z)
-- code from https://processing.org/examples/mandelbrot.html
local maxiterations = 100
-- Now we test, as we iterate z = z^2 + cm does z tend towards infinity?
local a = x/500
local b = z/500
local n = 0
while n < maxiterations do
local aa = a * a
local bb = b * b
local twoab = 2.0 * a * b
a = aa - bb + x/500
b = twoab + z/500
-- Infinty in our finite world is simple, let's just consider it 16
if aa + bb > 16.0 then
break -- Bail
end
n = n+1
end
-- We color each pixel based on how long it takes to get to infinity
-- If we never got there, let's pick the color black
if n == maxiterations then
return -1
else
-- Gosh, we could make fancy colors here if we wanted
return n
end
end
bobomb wrote:Then I have no idea where the mapgen sets the final surface height.
bobomb wrote:Otherwise does anyone know of a nice lua get_surface function?
bobomb wrote:is there an easy way to get the surface height?
paramat wrote:bobomb wrote:is there an easy way to get the surface height?
Before the corresponding mapchunk generates? immediately after the corresponding mapchunk generates? or anytime after the corresponding mapchunk generates?
Also remember there will be multiple surface heights if floating islands or overhangs are present, as in mgv5 and mgv7.
prestidigitator wrote:Minetest's coordinates span from like -32k to +32k in each dimension I believe, which if you consider a scale of 1m per node would only give you a 64km square area to play with.
Samson1 wrote:I think the hole map-gen idea for Minetest is rubbish, the worlds are to flat or to hilly, there are no mountains or lakes or underground streams or rivers or...
Users browsing this forum: No registered users and 6 guests