Help! Is there a way to disable a save slot for autosave?

Magusalfador

Veteran
Veteran
Joined
Jun 15, 2014
Messages
240
Reaction score
41
First Language
English Spanish
Primarily Uses
Hi all! Im trying to do an auto save system for my project, so I can have the game autosave in a designated slot. My question is, is there a way I can disable the player to access that slot , like, if he want to save the game he can use any other slot but the one Im using for autosaving is blocked for him? or more specifically, disable it for saving and only be enabled for loading?

Thanks!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You'll need someone to code it so that one save slot cannot be used.

Moved to Plug-In Requests

 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
251
Reaction score
232
First Language
English
Primarily Uses
RMMV
I wrote the code for this for my game, but it's not a plug-and-play plug-in. Are you familiar with Javascript? If you are, I can post my code and you can edit it for your own game (you'll need to have a specific savefileId that your own autosave code uses).
 

SeaPhoenix

Veteran
Veteran
Joined
May 14, 2015
Messages
251
Reaction score
232
First Language
English
Primarily Uses
RMMV
Here are the relevant functions; let me know if you have any questions. My own autosave file ID is 1, so you'll need to modify that twice in the code below if yours is different.

Code:
// New function - modify the savefileId if it's not 1
Window_SavefileList.prototype.isAutosave = function(savefileId) {
  return this._mode === 'save' && savefileId === 1;
};

// The following functions are overwritten; you may need to make further edits if you're using any save plugins.
Window_SavefileList.prototype.drawItem = function(index) {
  var id = index + 1;
  var valid = DataManager.isThisGameFile(id);
  var info = DataManager.loadSavefileInfo(id);
  var rect = this.itemRectForText(index);
  var isAutosave = this.isAutosave(id);  
  this.resetTextColor();
  if (isAutosave) {
    this.changePaintOpacity(false);
  } else if (this._mode === 'load') {
    this.changePaintOpacity(valid);
  }
    this.drawFileId(id, rect.x, rect.y);
    if (info) {
      var enabled = isAutosave ? !isAutosave : valid;
      this.changePaintOpacity(enabled);
      this.drawContents(info, rect, enabled);
      this.changePaintOpacity(true);
  }
};

// Change savefileId if it's not 1. Note that this drawText function uses a bigger width than the original function (because I rewrote how the other bits of information are displayed in my window), so you'll need to test to see it changes how things look in your own window. 
Window_SavefileList.prototype.drawFileId = function(id, x, y) {
    var text = TextManager.file + ' ' + id + (id === 1 ? ' (Autosave)' : '');
    this.drawText(text, x, y, 240);    
};
 

Magusalfador

Veteran
Veteran
Joined
Jun 15, 2014
Messages
240
Reaction score
41
First Language
English Spanish
Primarily Uses
Thaaaaank you! appreciated.
 

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top