Generate new (empty) mapchucks when abm reaches them.

Post Reply
tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Generate new (empty) mapchucks when abm reaches them.

by tbillion » Post

been looking and searching for almost 4 hours. cant find the answer to what seems a simple question...

how do you make an abm "see"an ungenerated map section and issue the code to generate it...

yeah i know code is complex, or takes lots of resources but i am only talking about generating 13x5x1 of map at a time.

I have an abm that moves on its own, when it hits an ungenerated map chunk it is forced to wait for the player so the chunk can be generated. if i bypass this, then when the map is generated it ruins the output of the abm.

i have a screen shot or two...

Image
Image

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Generate new (empty) mapchucks when abm reaches them.

by Don » Post

You would need to force load the block.
http://dev.minetest.net/minetest.forceload_block
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

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

Re: Generate new (empty) mapchucks when abm reaches them.

by tbillion » Post

forceloaded ... check... those screenshots were with the forceloaded block

Code: Select all

		                minetest.env:add_node(newpos, { name="abmtesting:abmroad", param1=lightcount, param2=facing })
				minetest.forceload_block(newpos)
				abmroad.placetbmroad(newpos, tostring(fuel))
				abmroad.setstackcount(newpos, "default:coal_lump", coalcount)
				local list = inv:get_list("inv")
				local newmeta = minetest.get_meta(newpos)
				local inv = newmeta:get_inventory()
				inv:set_list("inv", list)
				minetest.forceload_free_block(pos)
				minetest.env:remove_node(pos)

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Generate new (empty) mapchucks when abm reaches them.

by paramat » Post

Not sure force-load actually generates chunks, try 'emergeblocks' instead (0.4.13dev).

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

Re: Generate new (empty) mapchucks when abm reaches them.

by tbillion » Post

@paramat: no dice i even tried generating blocks in front of the abm. i tried one block at a time, 20 blocks at a time. same results grass on my field (or rather random mapgened blocks of stone in my road)

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests