Here is the first version of the plugin. I'll upload it to Pastebin, once it's finished:
Spoiler
/*: * @plugindesc Replaces the default load/save system of MV with a single savefile, that automatically gets used. * <Iavra Single Save> * @author Iavra * * @param Savefile Id * @desc The id to be used to save and load the game. I don't actually see, why anyone would want to change this. * @default 1 */var IAVRA = IAVRA || {};(function($) { "use strict"; /** * Loads the plugin parameters independent from the plugin's actual filename. */ var _params = $plugins.filter(function(p) { return p.description.contains('<Iavra Single Save>'); })[0].parameters; /** * The savefile id we will be using, to save/load the game. This can be changed via the "Savefile Id" plugin * parameter and will automatically be kept within the range [1, 20] (or whatever DataManager.maxSavefiles() is). */ var _savefileId = (parseInt(_params['Savefile Id']) || 0).clamp(1, DataManager.maxSavefiles()); //============================================================================= // IAVRA.SINGLESAVE //============================================================================= $.SINGLESAVE = { /** * Saves the game in the designated save slot and returns, whether the save was a success or not. Can also be * used to implement an autosave or quicksave. */ save: function() { $gameSystem.onBeforeSave(); return DataManager.saveGame(_savefileId); }, /** * Loads the game from the designated save slot and returns, whether the load was a success or not. Can also be * used to implement a quickload. */ load: function() { if(DataManager.loadGame(_savefileId)) { $gameSystem.onAfterLoad(); Scene_Load.prototype.reloadMapIfUpdated.call(null); SceneManager.goto(Scene_Map); if(SceneManager._scene) { SceneManager._scene.fadeOutAll(); } return true; } else { return false; } } }; //============================================================================= // Scene_Title //============================================================================= (function($) { /** * On continue, automatically load the designated savefile. If the load was a success, play the sound effect, * close the command window and fade out the scene. If the load failed, play the buzzer and reactivate the * command window. */ $.prototype.commandContinue = function() { if(IAVRA.SINGLESAVE.load()) { SoundManager.playLoad(); this._commandWindow.close(); } else { SoundManager.playBuzzer(); this._commandWindow.activate(); } }; })(Scene_Title); //============================================================================= // Scene_Menu //============================================================================= (function($) { /** * On save, automatically save to the designated savefile and play a sound effect, depending on whether the * save was a success or failure. Also reactivate the command window, since we haven't changed the scene. */ $.prototype.commandSave = function() { if(IAVRA.SINGLESAVE.save()) { SoundManager.playSave(); } else { SoundManager.playBuzzer(); } this._commandWindow.activate(); }; })(Scene_Menu); //============================================================================= // DataManager //============================================================================= /** * Since we only care about a single savefile, we only need to check that one. Otherwise, the "continue" option of * the title scene would be activated, if a different savegame exists. */ DataManager.isAnySavefileExists = function() { return this.isThisGameFile(_savefileId); };})(IAVRA);
Features:
- The "Continue" option of the title menu automatically loads savefile #1 (or whatever id was set in the plugin parameters).
- The "Save" option of the game menu automatically saves to the same savefile.
- The script calls "IAVRA.SINGLESAVE.save()" and "IAVRA.SINGLESAVE.load()" can be used to quicksave/quickload the game (can be used for autosaving, too).
Planned Features:
- Automatically overwrite the savefile, when starting a new game (controllable by plugin parameter?)
- If overwrite is enabled: Ask the player, if he really wants to overwrite the existing save, before starting a new game.
- Maybe show a "game saved" popup, when the player pressed "Save" in the game menu, because currently the sound effect is the only feedback to know, whether the save was successful.
Please note, that the event command "Open Save Screen" shouldn't be used, since it's technically still possible to save the game in other slots (although the "Continue" option of the title scene will only be enabled, if the specified savefile exists. Other will be ignored).
/edit: I can change the "Open Save Screen" command to either
1) do nothing
2) automatically save the game
3) open a dialog: "save game?" Yes/No
Which would you prefer?