But the things I've tried have resulted in a crash.
I've looked at both gemstones and moreores to see how they did it, but I have no idea where their first "for X x do" comes from. (I mean the things in between the "for and "do")
So I tried to write a spin-off of their code; however it did not work, and resulted in a crash.
Here is the crash error
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
11:21:22: ERROR[ServerThread]: ERROR: An unhandled exception occurred: Access violation
In thread e14:
C:\tmp\minetest\src\server.cpp:118: ServerThread::Thread: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7fc:
#0 MeshUpdateThread::Thread
DEBUG STACK FOR THREAD 988:
And here's the code
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 flatland = function( minp, maxp )
local start = -30000
local final = 30000
local pos = {
x = minp.x,
y = minp.y,
z = minp.z,
}
while start < final do
if pos.y > 0 then
minetest.env:remove_node(pos)
end
pos = {
x = pos.x + 1,
y = pos.y + 1,
z = pos.z + 1,
}
start = start + 1
end
end
minetest.register_on_generated( flatland )
Anyone care to explain to me how minetest.register_on_generated works? Because I'm currently lost.