From 25e1398229dd1847b4fb3d35aaeb39067b26861f Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sun, 13 Apr 2025 18:11:46 +0200 Subject: [PATCH] Revert "fixed mod export command" This reverts commit 7f4159b6c6965c09a01348cc93b956cf8f312de7. --- docs/migrating-from-2.0.0-alpha.13.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/migrating-from-2.0.0-alpha.13.md b/docs/migrating-from-2.0.0-alpha.13.md index 272e947a..355db4b8 100644 --- a/docs/migrating-from-2.0.0-alpha.13.md +++ b/docs/migrating-from-2.0.0-alpha.13.md @@ -8,6 +8,10 @@ Please study the entire migration guide carefully before attempting to update an If you're using mods you need to create mod pack string for the mod configurations you're currently running. You can do this by running the follow RCON command on an instance that is currently running the mod configuration you want to use (you can also run this command in single player and find the string printed in Factorio's [Log file](https://wiki.factorio.com/Log_file)): + /sc local m={name="pack",description="",factorio_version=game.active_mods.base,mods={},settings={startup={},["runtime-global"]={},["runtime-per-user"]={}}} for n,v in pairs(game.active_mods) do table.insert(m.mods,{name=n,enabled=true,version=v}) end local function set(s,c) for n,v in pairs(s) do m.settings[c][n]=v end end set(settings.startup,"startup") set(settings.global,"runtime-global") if game.player then set(game.player.mod_settings,"runtime-per-user") else set(settings.player,"runtime-per-user") end local e=game.encode_string(game.table_to_json(m)) log(e) rcon.print(e) + +If you for some reason want to run this function in 2.0+, use the following command: + /sc local a={name="pack",description="",factorio_version=script.active_mods.base,mods={},settings={startup={},["runtime-global"]={},["runtime-per-user"]={}}}for b,c in pairs(script.active_mods)do table.insert(a.mods,{name=b,enabled=true,version=c})end;local function d(e,f)for b,c in pairs(e)do a.settings[f][b]=c end end;d(settings.startup,"startup")d(settings.global,"runtime-global")if game.player then d(game.player.mod_settings,"runtime-per-user")else d(settings.player,"runtime-per-user")end;local g=helpers.encode_string(helpers.table_to_json(a))log(g)rcon.print(g) This should produce a [Mod Pack String](https://forums.factorio.com/viewtopic.php?f=96&t=103578) which you need to copy and paste somewhere to keep it for later.