Lua Save game API

Currently, saving is disabled during character generation. This is hard coded.

I propose that saving be dehardcoded and made accessible by lua scripts for modding purposes.

This is my first issue post, sorry if it's not quite up to the expected standard.

The following functions should be added, probably to openmw.core

  • SaveGame CreateSave(string name) This creates a save game with the specified name. This should always succeed, even if saving is disabled. Returns the newly created save game, or nil on an error
  • SetSaveEnabled(bool manual, bool autosaves) Set manual to false to prevent the player saving the game normally (quicksave button disabled, menu option not shown, etc). If autosaves is false, it also disables autosaves from being created.
  • LoadSave(SaveGame savegame). Loads the specified save game. Leave blank to load the latest save game for that character
  • GetSaves(). Gets a list of savegames for the current character

I have purposely left the details blank, as I am not sure how this should be implemented, what each function should return, etc.

We probably shouldn't add a DeleteSave or equivalent function, I could see how mods could be abusive with that.

Edited by Paul T