Page 1 of 1

how to reference a specific block -w- minetest.emerge_area

PostPosted: Wed Dec 23, 2015 06:32
by tbillion
i am trying to emerge only one singe node with this call, i know that it emerges the entire map blocks referenced by it but what would i do if i only wanted to emerge a single node?

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
  minetest.emerge_area({x=pos.x-10, y=pos.y-10, z=pos.z-10}, {x=pos.x+10, y=pos.y+10, z=pos.z+10})


would i use the cordinates as a float like:

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
  minetest.emerge_area({x=3.125, y=3.125, z=3.125}, {x=3.125, y=3.125, z=3.125})


i cannot figure out exactly how the code would work in order to emerge only one block.

or how would i find out the map block i am working in?

Re: how to reference a specific block -w- minetest.emerge_ar

PostPosted: Wed Dec 23, 2015 14:10
by rubenwardy
As part of the design, mods aren't supposed to interact or know about blocks. (This is kind of flawed, though.)

To find the map block, add an offset then divide by 16 (Not sure if this is a setting called block_size)
I'm not sure what the offset is, however. You'll have to experiement with map_generation_limit = 81

Also, you can't generate a mapblock on its own. Mapblocks are generated as mapchunks (iirc, 8x8x8 MapBlocks.)

Re: how to reference a specific block -w- minetest.emerge_ar

PostPosted: Thu Dec 24, 2015 00:53
by tbillion
well if its not supposed to know about mapblocks then why emerge area instead of emerge node/block? i am just tired of getting my machine wiped out when i hit the ignore blocks because the map hasnt been generated where the machine is . trying to work around that.

and off tropic while i have your attention; i remember seeing on your tutorial site and example on how to change the character size but now i cant find it do you happen to have the link?

Re: how to reference a specific block -w- minetest.emerge_ar

PostPosted: Wed Jan 27, 2016 03:21
by Christian9
i could use some help too