Nore wrote:Where does the VoxelArea thing come from? It gives me a nil value error when I try to run that code...
MirceaKitsune wrote:I'll switch my Structures mod to it as soon as it's safe. There's one thing I don't understand though: How do you send a list of nodes to the engine for spawning? read_from_map(p1, p2) has two corners you can specify like I thought, but write_to_map() takes no parameters. Instead it takes another data writing function which I wasn't able to understand. How would I handle a list of the form { { pos1, node1 }, { pos2, node2 } }?
ch98 wrote:Is this the thing that makes large spaceships possible? If it is, Minetest is now close to complete!
hmmmm wrote:Also:
Apparently, having no way to find the real name of a node was a long-standing problem in mods.
As luck would have it, two API that were added needed by VoxelManip, minetest.get_content_id() and minetest.get_name_from_content_id(), can be used to find the real name of a node alias as follows:
local c = minetest.get_content_id(alias_name)
local real_name = minetest.get_name_from_content_id(c)
ItemStack("alias"):get_name()
hmmmm wrote:For testing purposes, I made a very simple 3d noise-based map generator, which can also be used as a decent reference of how to use VoxelManip
data[vi] = c_dirt
There will be a biome api in mg v7.Prestotron562 wrote:Can't wait for this. This will help my mod "More Biomes"
paramat wrote:it is helpful to work through a chunk column by column, and working down each column instead of up
for x=minp.x, maxp.x, 1 do
for z=minp.z, maxp.z, 1 do
local n = noise:get2d({x=x,y=z})
local q = math.abs(math.floor(n*128))
local c=q+128
for y=minp.y, maxp.y, 1 do
... build it based on the height data from the 2d noise
[The extension lua has been deactivated and can no longer be displayed.]
[The extension pgm has been deactivated and can no longer be displayed.]
[The extension pgm has been deactivated and can no longer be displayed.]
paramat wrote:Some advice on your use of perlin noise......
Users browsing this forum: No registered users and 3 guests