Page 1 of 1

flat land map request

PostPosted: Thu May 09, 2013 13:13
by zoropig
is there a way to make a flatland map?

PostPosted: Thu May 09, 2013 13:53
by epsonok0
Go into your config file and open it with notepad.
Paste the following.

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
mg_flags = trees, caves, flat


Then allow it to generate.

PostPosted: Sun Jun 16, 2013 18:54
by Linxx
doesn't work for me

PostPosted: Sun Jun 16, 2013 18:55
by PilzAdam
Linxx wrote:doesn't work for me

You are doing something wrong.

PostPosted: Sun Jun 16, 2013 19:46
by Linxx
but i'm doing what was said here

PostPosted: Sun Jun 16, 2013 19:56
by kaeza
Are you sure you are editing `minetest.conf' and not `minetest.conf.example'?
Also, check that there's no '#' in front of the mg_flags line.

PostPosted: Sun Jun 16, 2013 20:11
by Linxx
there's 2 conf?

PostPosted: Sun Jun 16, 2013 20:17
by kaeza
Linxx wrote:there's 2 conf?

Nope. One is the real conf, the other is an example file.

PostPosted: Sun Jun 16, 2013 20:23
by PilzAdam
Also make sure that you generate a new map after adding it.

PostPosted: Sun Jun 16, 2013 21:44
by Linxx
i'm royally confused now i see one that says minetest but doesn't have the same things the example has...
Edit: nvm i figured it out i was using the example xD sorry for the confusion

PostPosted: Tue Aug 20, 2013 20:51
by lunisol
I did exactly as said and still it didnt work. I was in .conf, not the example, I generated a new map after I added the lines and there was no # sign. should I have added the line at the top of the config? I added it to the bottom, or does it even matter where you add the line.


edit: I get this error:
16:53:01: ACTION[main]: World at [C:\Users\CC-JAR\Desktop\games\pc\minetest\bin\..\worlds\flattest]
16:53:01: ACTION[main]: Server for gameid="minetest" listening on port 30011.
2: Bind failed: No error
creative inventory size: 176
16:53:01: ERROR[main]: ServerError: Failed to bind socket (port already in use?)

PostPosted: Fri Aug 23, 2013 15:21
by Rhys

PostPosted: Fri Aug 23, 2013 18:01
by Casimir
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.register_on_mapgen_init(function(mgparams)
    minetest.set_mapgen_params({mgname="singlenode"})
end)

minetest.register_on_generated(function(minp, maxp, seed)
--    local t1 = os.clock()
    if minp.y > 1 then
        return
    end
    local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
    local a = VoxelArea:new{
        MinEdge={x=emin.x, y=emin.y, z=emin.z},
        MaxEdge={x=emax.x, y=emax.y, z=emax.z},
    }
 
    local data = vm:get_data()
 
    local c_water = minetest.get_content_id("default:water_source")
 
    local sidelen = maxp.x - minp.x + 1
 
    local ni = 1
    for z = minp.z, maxp.z do
    for y = minp.y, maxp.y do
    for x = minp.x, maxp.x do
        if y < 1 then
            local vi = a:index(x, y, z)
                data[vi] = c_water
        end
        ni = ni + 1
    end
    end
    end

    vm:set_data(data)
       
    vm:calc_lighting(
        {x=minp.x-16, y=minp.y, z=minp.z-16},
        {x=maxp.x+16, y=maxp.y, z=maxp.z+16}
    )
 
    vm:write_to_map(data)
 
--    print(string.format("[unternull] building water: elapsed time: %.2fms", (os.clock() - t1) * 1000))
end)

That creates a flat map with only one type of node (in this case water). No mg_flags needed. Only works in one of the latest builds.