Single Save File

● ARCHIVED · READ-ONLY
Started by GameDevon 16 posts View original ↗
  1. Hello everyone!

    I was wondering if there was a way to implement a single save file system, much like the save system used in Pokemon and Undertale?

    Would that be possible through eventing?
  2. for mv, I think so. (try requesting)

    for previous maker, YES. there's already exist that kind of script.
  3. Not with eventing, but it's pretty easy to do with a plugin.


    /edit: I've had enough WebGL for the next time, anyway, so i'll write a plugin for this (unless someone else finds an existing one, first).
  4. Thanks for the replies!

    @lavra if you do get around to writing, please let me know  :guffaw:
  5. 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?
  6. (In the future, post general how-to/is-this-possible questions in the appropriate Support subforum, not in Game Mechanics Design.  Script requests go in the appropriate Script Request subforum.)

    I believe the default scripts contain a parameter for "max save files" (VX Ace's is "self.savefile_max" under DataManager) where you can choose how many save files there are.  You can choose "1" if you want to!  I guess Pokemon let you save with a single click rather than making you choose this one save file, but this would be a really good stopgap until someone makes a script for you.
  7. It's here:

    DataManager.maxSavefiles = function() { return 20;};But yeah, this would still show the save/load menus displaying 1 entry. Although this would be an interesting alternative: Instead of just saving/loading the game, i could modify the save/load menus to display the 1 save in a better way (show more details, maybe map snapshot, etc).Since this is GameDevon's request, i'll leave it up to him/her to choose the alternative:

    - Completely disable the save/load menus and just use the 1 save.

    - Modify the menus to just display the 1 save and show more detailed information.
  8. I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.


    Game Mechanics Design is for discussing the pros/cons of design aspects and getting feedback/suggestions, not for "how do I do this in my game?"
  9. Shaz said:
    Game Mechanics Design is for discussing the pros/cons of design aspects and getting feedback/suggestions, not for "how do I do this in my game?"
    Ahh got it, sorry!

    @Wavelength thanks for the idea! I will keep that in mind.

    @lavra thank you so much! The features you've added so far and the ones you plan to add are perfect!

    On using the event command "Open Save Screen", I don't think I will have that problem as I evented a custom menu (shown in the spoiler below) with no save option as I will be using save points instead.

    Automatically overwriting save file, confirming the overwrite and showing a game saved popup would be perfect though!

    However, it seems to me that those can be done using choices and show text in events - am I missing something?

    Thanks again. You are a shining beacon of light  :guffaw:

    Spoiler
  10. I remade the plugin a bit, according to Wavelength's comment: http://pastebin.com/GzrKd2zM


    The save/load menu will display the save contents, a short message and a confirmation windows ("load game?" "Yes"/"No"). When creating a new game, the game will be saved with a confirmation dialogue, if there was already an existing save.


    For quick-/autosave or quickload it's still possible to bypass the dialogues and directly save/load via "IAVRA.SINGLESAVE.save()" / "IAVRA.SINGLESAVE.load()".


    Btw: I totally love the visuals of your game.
  11. Aaaaaahhh thank you, it's working beautifully!

    "IAVRA.SINGLESAVE.save()" / "IAVRA.SINGLESAVE.load()" would go into plugin commands am I right?

    Also, can I credit you as Iavra or would you prefer another title  :guffaw:

    Btw: I totally love the visuals of your game. 
    Thank you for this too hahaha
  12. No, Iavra is fine (as long as you don't make it Lavra :D )


    Those are script calls (Event Commands -> Page 3 -> Script...), but i can add plugin commands, if you want.
  13. Gotcha! Nah script calls are fine, thanks
  14. GameDevon: How did you make the Menü Screen like that? It looks great and clean. Can you tell me where you got it from? Thank you very much.

    GameDevon said:
    Ahh got it, sorry!


    @Wavelength thanks for the idea! I will keep that in mind.


    @lavra thank you so much! The features you've added so far and the ones you plan to add are perfect!


    On using the event command "Open Save Screen", I don't think I will have that problem as I evented a custom menu (shown in the spoiler below) with no save option as I will be using save points instead.


    Automatically overwriting save file, confirming the overwrite and showing a game saved popup would be perfect though!


    However, it seems to me that those can be done using choices and show text in events - am I missing something?


    Thanks again. You are a shining beacon of light  :guffaw:


    Hidden Content
  15. Iavra said:
    I remade the plugin a bit, according to Wavelength's comment:


    The save/load menu will display the save contents, a short message and a confirmation windows ("load game?" "Yes"/"No"). When creating a new game, the game will be saved with a confirmation dialogue, if there was already an existing save.


    For quick-/autosave or quickload it's still possible to bypass the dialogues and directly save/load via "IAVRA.SINGLESAVE.save()" / "IAVRA.SINGLESAVE.load()".


    Btw: I totally love the visuals of your game.


    Hey lavra, I've been working on my first game for a while now and I've been looking for an autosave script call + single save file system. I just wanted you to know how glad and thankful I am for the plugin you created, it's absolutely imperative for the "Gacha" mechanic in my game to work.

    God bless you and thank you so much!
  16. mtmune_, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.