Sorry for the late reply. Glad to see you found a work-around.
Hi, I recently worked out a per surface method to create a pure empty surface. I believe it would work for your mod.
Some of the code is here.
script.on_event(defines.events.on_tick, function(event)
if game.tick == 0
then
main_surface = dft.gen_empty_surface("debug",200,200)
game.players[1].teleport({0,0},main_surface)
...
And for the chunk generated callback:
script.on_event(defines.events.on_chunk_generated, function(event)
--game.print(event.position.x .." " .. event.position.y)
if event.position.x>-5 and event.position.x<5 and event.position.y>-5 and event.position.y<5
then
if event.surface == main_surface then
local surface = event.surface
local tiles = {}
for x = event.area.left_top.x, event.area.right_bottom.x-1 do
for y = event.area.left_top.y, event.area.right_bottom.y-1 do
local tile_name = event.surface.get_tile(x,y).name
if tile_name == "water" or tile_name == "deepwater"
then table.insert(tiles, { name = "grass-2",position = {x,y} })
else table.insert(tiles, { name = tile_name,position = {x,y} })
end
end
end
surface.set_tiles(tiles, true)
local simple_entities = surface.find_entities_filtered{event.area, type = "simple-entity"}
for k,v in pairs(simple_entities)do
v.destroy()
end
end
end
end)
And the very primary part of this
gen_empty_surface = function(name, width, height)
width = width or 1
height = height or 1
local mgs = {
autoplace_controls = {
coal = {
frequency = 1,
richness = 1,
size = 0
},
["copper-ore"] = {
frequency = 1,
richness = 1,
size = 0
},
["crude-oil"] = {
frequency = 1,
richness = 1,
size = 0
},
["enemy-base"] = {
frequency = 1,
richness = 1,
size = 0
},
["iron-ore"] = {
frequency = 1,
richness = 1,
size = 0
},
stone = {
frequency = 1,
richness = 1,
size = 0
},
trees = {
frequency = 1,
richness = 1,
size = 0
},
["uranium-ore"] = {
frequency = 1,
richness = 1,
size = 0
}
},
autoplace_settings = {},
cliff_settings = {
cliff_elevation_0 = 10,
cliff_elevation_interval = 40,
name = "cliff",
richness = 0
},
peaceful_mode = false,
property_expression_names = {},
seed = 4083961782,
starting_area = 1,
starting_points = {
{
x = 0,
y = 0
}
},
terrain_segmentation = 1,
water = 0,
height = height,
width = width
}
return game.create_surface(name, mgs)
end
Besides this, all you need to do is teleporting all the players to the surface, and set the respawn area to the new surface. That would work.