Skip to content

Command line option to automatically load a save game on DF launch, bypassing main menu, and load a different game into current DF #755

@TheBloke

Description

@TheBloke

I don't know if any of this is possible - perhaps not, else it's the sort of thing that would already exist! But just in case:

  • Add a command line option that will load DF straight into the named save game, bypassing (or at least instantly auto-navigating) the main menu
    • Will open DF and cause data/save/xyz/ to be loaded; no main menu is shown; the user first sees the normal game loading screens and once these are completed is at the map.
  • Would be somewhat useful for all users, who most likely use the main menu 95% of the time only to load their current save and might thus appreciate the ability to set up a shortcut that takes them straight into it.
  • Also useful for speeding DFHack testing in situations where a new DF instance is required because load/unload is insufficient
    • Could also enable some basic automated testing: create a script that launches DF into a given game, execute a defined lists of commands then exit at the end.
  • Other potentially useful options:
    • Load the most recent save
    • Load a random save from a given list
    • Load save 1, run comands XYZ, then load save 2, etc
    • If necessary all could be achieved from the launcher script rather than the plugin itself

Example invocation:

  • Windows: DwarfFortress.exe -load region1 or, DFLoaderScript.bat -load region1
  • Linux/OSX: ./dfhack -load region1
    • If DFHack can't read DF's argc/argv, then perhaps this could be facilitated by a launcher script/batch file (a new one for Windows, existing dfhack for *nix)
      • The launcher script writes the name of the game to load to a text file which is then checked by a plugin; if the file is found and the game name within it is valid, the plugin loads this game on DF launch. The plugin then deletes the text file.
      • Or the script uses the API to pass a "load game" command to the DFHack plugin - assuming the plugin can load fast enough to accept the command in a timely manner from the same script that launched it

And the ability to switch saves in a loaded DF:

  • DFHack plugin the can be executed from console/Lua UI: loadgame xyz
    • When executed, kills the current game (like die) but does not exit DF; instead loads a different game into existing DF
    • Equivalent to quitting back to the main menu (without deleting all saves) and loading a different game.

Metadata

Metadata

Assignees

Labels

ideaSuggestions, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions