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

tbillion
Member
 
Posts: 189
Joined: Wed Apr 03, 2013 16:07

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

by tbillion » Wed Dec 23, 2015 06:32

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?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

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

by rubenwardy » Wed Dec 23, 2015 14:10

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.)
 

tbillion
Member
 
Posts: 189
Joined: Wed Apr 03, 2013 16:07

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

by tbillion » Thu Dec 24, 2015 00:53

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?
 

User avatar
Christian9
Member
 
Posts: 273
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9

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

by Christian9 » Wed Jan 27, 2016 03:21

i could use some help too
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 1 guest