Generate new (empty) mapchucks when abm reaches them.

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

Generate new (empty) mapchucks when abm reaches them.

by tbillion » Wed Nov 25, 2015 14:06

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: 1641
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 » Wed Nov 25, 2015 14:52

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: 189
Joined: Wed Apr 03, 2013 16:07

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

by tbillion » Wed Nov 25, 2015 16:39

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)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

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

by paramat » Thu Nov 26, 2015 14:05

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

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

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

by tbillion » Fri Nov 27, 2015 13:53

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


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron