Page 1 of 1

Generate new (empty) mapchucks when abm reaches them.

PostPosted: Wed Nov 25, 2015 14:06
by tbillion
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

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

PostPosted: Wed Nov 25, 2015 14:52
by Don
You would need to force load the block.
http://dev.minetest.net/minetest.forceload_block

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

PostPosted: Wed Nov 25, 2015 16:39
by tbillion
forceloaded ... check... those screenshots were with the forceloaded block

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

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

PostPosted: Thu Nov 26, 2015 14:05
by paramat
Not sure force-load actually generates chunks, try 'emergeblocks' instead (0.4.13dev).

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

PostPosted: Fri Nov 27, 2015 13:53
by tbillion
@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)