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

tbillion
Member
 
Posts: 189
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone

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?

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:

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
Moderator
 
Posts: 5858
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
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
Location: 38381, US, TN, Toone

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: 337
Joined: Fri Sep 19, 2014 20:29
Location: Hell Creek
In-game: Christian9
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest