Page 1 of 1

Startup option to list save-game metadata

Posted: Thu Aug 05, 2021 2:34 am
by quyxkh
Like most people on Linux I think, I have an options-processing frontender to start factorio from the command line. So just `Factorio` hunts down the latest savegame (or autosave), or I can say `Factorio -b sometest` and it'll hunt down the latest save game with `sometest` in its name and start it with benchmarking set up the way I like it, and so on. `Factorio $(mr ~/down)` starts factorio with the last thing I downloaded, because I've got a `mr` command to show me the most recent thing at that path, `Factorio -M seablock` starts Factorio with the most recent save and my seablock mods list, and so on.

But the thing I can't do without some fragile binary spelunking I'm trying to avoid is tell what mods I should have active to load a map. The GUI will show me that, after loading a possibly-wrong set. Any chance of getting a `--show-metadata` startup option to quickly show the same map and mod versions and maybe scenario name info the Load Game screen shows?

Code: Select all

$ factorio --show-metadata FILE        # same FILE search the other map-loading options use, with the negligible startup overhead of the `--benchmark` option.
{  
    map_version = "1.1.37",
    scenario = "freeplay",
    mods = { base = "1.1.37", HallOfFame = "1.9.0" },
 } 
 $
 

or json instead of lua might be more to taste.

I've got this feeling I'm not the first to ask for something like this, but searching for map metadata showed nothing similar in the first maybe couple dozen hits so here it is again I guess.

Re: Startup option to list save-game metadata

Posted: Thu Aug 05, 2021 2:59 am
by Silari
Wouldn't it be easier (and possibly simpler to implement) to just have a command line switch that does the same thing as the 'Sync mods to save' button when a save file is provided?

Re: Startup option to list save-game metadata

Posted: Thu Aug 05, 2021 3:13 am
by quyxkh
Silari wrote:
Thu Aug 05, 2021 2:59 am
Wouldn't it be easier (and possibly simpler to implement) to just have a command line switch that does the same thing as the 'Sync mods to save' button when a save file is provided?
That might be easier but it wouldn't allow for people adding their favored QoL mod set to maps.

There's all kinds of alternate possibilities you could imagine, I'm asking for what I think is the simplest to implement, just spitting info the game is already acquiring, the code's almost all written already. If I'm dreaming the cli allows multiple mod-enable json's in the mods directory and you can supply a list, like `--mods base,seablock,mystuff` and it looks for `base.json` or if that doesn't exist it looks for a "base" mod, and so forth, and loads up the union, but all of that stuff is easy to script, which I've already got. I'm just asking for what I can't already get reliably.

Command line option to list metadata of saved game

Posted: Wed Jun 22, 2022 3:19 am
by quyxkh
I'd really like it if Factorio had a command-line option to dump metadata about save files, like the mods & versions list, the current tick, the last non-autosave file the map was saved to, maybe list of known players, whatever. Mostly for me the mod list, because a modpack mismatch is always unnecessary and gets annoying, life is good enough that it can be the worst thing that happens to you all day, and when it happens *repeatedly* all day, well, there's nerd rage in the air.

Re: Command line option to list metadata of saved game

Posted: Thu Jun 23, 2022 3:39 am
by ssilk
splitted from viewtopic.php?f=6&t=1255 Sorting savegames: by date / world… into new topic

…then merging with existing topic

:roll: