Single Save File

GameDevon

Animagical Person
Member
Joined
Dec 12, 2015
Messages
16
Reaction score
20
First Language
English
Primarily Uses
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?
 

izyees

My Secret Santa
Veteran
Joined
Oct 24, 2015
Messages
248
Reaction score
67
First Language
english
for mv, I think so. (try requesting)

for previous maker, YES. there's already exist that kind of script.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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).
 
Last edited by a moderator:

GameDevon

Animagical Person
Member
Joined
Dec 12, 2015
Messages
16
Reaction score
20
First Language
English
Primarily Uses
Thanks for the replies!

@lavra if you do get around to writing, please let me know  :guffaw:
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Here is the first version of the plugin. I'll upload it to Pastebin, once it's finished:

/*: * @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?
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
(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.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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?"
 
Last edited by a moderator:

GameDevon

Animagical Person
Member
Joined
Dec 12, 2015
Messages
16
Reaction score
20
First Language
English
Primarily Uses
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:

 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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.
 
Last edited by a moderator:

GameDevon

Animagical Person
Member
Joined
Dec 12, 2015
Messages
16
Reaction score
20
First Language
English
Primarily Uses
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
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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.
 

GameDevon

Animagical Person
Member
Joined
Dec 12, 2015
Messages
16
Reaction score
20
First Language
English
Primarily Uses
Gotcha! Nah script calls are fine, thanks
 

Pupa

Warper
Member
Joined
Feb 6, 2014
Messages
1
Reaction score
0
First Language
German
Primarily Uses
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.

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
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top