How to move your save to a new map / regenerate map?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
wvlad
Fast Inserter
Fast Inserter
Posts: 215
Joined: Thu Jul 13, 2017 9:55 pm
Contact:

How to move your save to a new map / regenerate map?

Post by wvlad »

After installing Alien Biomes I decided to start a new map because there is no possibility to regenerate terrain without touching entities. So here is the instruction for anyone who wants the same:

1. Make blueprints of everything you need. Go into each Factorissimo buildings and make a blueprint of everything inside. Save them in library. Don't blueprint the whole base with mining drills, you will want to place them at a different place. You can make blueprints from map view and you can move while selecting blueprint area.
2. You can't transfer chest content in blueprints so put all items you will need in "new game+" into inventory and quick bar.
3. Take items out of your armor and put to your inventory. Put your armor and weapon to inventory too.
4. Copy-paste and execute in console (yes, you can paste multiline there):

Code: Select all

/c local techs = "\nlocal techs = {"
for _, research in pairs(game.player.force.technologies) do
if research.researched then
techs = techs .. " [\""..research.name.."\"] = true,"
end
end
techs = techs .. "}"
log("\nlocal inv = "..serpent.block(game.player.get_inventory(defines.inventory.player_main).get_contents())..
"\nlocal qb = "..serpent.block(game.player.get_inventory(defines.inventory.player_quickbar).get_contents()).."\n"..techs)
5. Open log file and copy everything starting from "local inv = {" including it. It contains your inventory and researches.
6. Open your new map
7. Open any text editor, attach your copied text before this, add "/c " at the start and then copy paste and execute it all together in console:

Code: Select all


for i=1,10 do 
for _, research in pairs(game.player.force.technologies) do 
if techs[research.name] and not research.researched then 
research.researched=true 
script.raise_event(defines.events.on_research_finished, {research = research, player_index = game.player.index})
end
end
end
game.player.get_quickbar().clear()
game.player.get_inventory(defines.inventory.player_main).clear()
for item,count in pairs(qb) do
game.player.get_quickbar().insert{name=item, count = count}
end
for item,count in pairs(inv) do
game.player.insert{name=item, count = count}
end
9. For each blueprint:
9.1 place where you want (use Shift to ignore collisions, make sure to not place them on water) so you can see its area
9.2 select all area with deconstruction tool and execute to clean terrain

Code: Select all

/c for _,entity in pairs(game.player.surface.find_entities()) do if entity.to_be_deconstructed(game.player.force) then entity.destroy() end end
9.3 place it again at the same place and execute

Code: Select all

/c for _,entity in pairs(game.player.surface.find_entities_filtered{type="entity-ghost"}) do local revived, entity = entity.revive() if entity and entity.valid then script.raise_event(defines.events.on_built_entity, {created_entity = entity, player_index = game.player.index}) end end

This will build everything immediately.

Good luck with your new map :)

Post Reply

Return to “Gameplay Help”