Hey all. Wondering if it's possible to create an entirely empty map? I want to create a custom map with pre-defined resource locations, removing everything else on the map. To be clear I want to start with the entire world being empty, no trees, resources, water, etc.
I've so far accomplished this in the map editor by creating massive water areas (so that everything where the water is placed will be deleted) and then filling in the water with land to create an empty square of land, but this seems sub-optimal.
Anyone done this before?
Creating an empty map?
Re: Creating an empty map?
Here was custom map generation.
[MOD 0.14.x] Water maze
viewtopic.php?f=94&t=21568
https://m.imgur.com/a/wptLh
[MOD 0.14.x] Water maze
viewtopic.php?f=94&t=21568
https://m.imgur.com/a/wptLh
Re: Creating an empty map?
Thanks for the link, that looks similar to what I am trying to do.darkfrei wrote:Here was custom map generation.
[MOD 0.14.x] Water maze
viewtopic.php?f=94&t=21568
https://m.imgur.com/a/wptLh
I found some modified code in that thread on the last page which illustrates how to make the chunk generator generate only water chunks, but when I follow the instructions for making it generate only land chunks, it generates land with resources on it!
So, somehow I need to either figure out how to generate land and then wipe it as part of chunk generation, or I need to do a second pass after generating water and convert it to land.
Anyone have an idea how I could modify the water maze mod to do that?
Re: Creating an empty map?
You can override the autoplace controls when you create a new surface.
Have a read in the documentation here http://lua-api.factorio.com/latest/LuaG ... te_surface
When providing a MapSettings table, provide an empty autoplace controls object. It should generate nothing at all.
Have a read in the documentation here http://lua-api.factorio.com/latest/LuaG ... te_surface
When providing a MapSettings table, provide an empty autoplace controls object. It should generate nothing at all.
Re: Creating an empty map?
Surfaces sound promising... I ended up making a little mod to do it:
Code: Select all
local function make_chunk(event)
local x1 = event.area.left_top.x
local y1 = event.area.left_top.y
local x2 = event.area.right_bottom.x
local y2 = event.area.right_bottom.y
local surface = event.surface
local replace_type = "dirt-dark"
tiles = {}
for x = x1, x2 do
for y = y1, y2 do
local existing_type = surface.get_tile(x, y).name
if existing_type ~= replace_type then
table.insert(tiles, {name = replace_type, position = {x, y}})
end
end
end
surface.set_tiles(tiles)
for key, entity in pairs(event.surface.find_entities(event.area)) do
if entity.type ~= "player" then
entity.destroy()
end
end
surface.destroy_decoratives(event.area)
end
local function on_load(event)
script.on_event(defines.events.on_chunk_generated, make_chunk)
end
local function on_init(event)
on_load(nil)
end
script.on_init(on_init)
script.on_load(on_load)