MV [Solved] Prevent specific save file from being loaded

Hello! I have a problem that hopefully can get solved by a simple plugin.

TLDR, the plugin just needs to do the following:
"If Player loads File 99, load File 1 instead of File 99"

For more context and why I need this to begin with, here is my situation:
My game has two save files, 1 and 99. 1 is the save file the player uses to save the game automatically, while 99 is an autosave file I use to store global variables that stay the same across saves (I use Mr. Trivels GlobalSaveData plugin for this). Whenever I want to autosave, I use the script call "DataManager.saveGame(99)". If the player chooses file 1 in the load screen by either clicking it or pressing down/up before pressing Z/Space/Enter, everything works perfectly. However, if the player just presses space on the load screen, it automatically loads the last save, which in this case is file 99, even though this file is not visible to the player (I made every save after 1 invisible to the player by using "DataManager.maxSavefiles = function() { return 1; };" as a plugin). This confuses the players, since they want to load their last manual save and not my autosave. I believe the easiest way to solve this is to make File 99 not loadable by automatically making it load File 1 if the player chose to load File 99.

I hope everything is clear, please let me know if it isn't. Thanks in advance!
That's weird - are you using any kind of custom load scene? In my game, it loads the file that is visibly highlighted.
That's weird - are you using any kind of custom load scene? In my game, it loads the file that is visibly highlighted.
Hi, I use the normal load scene but, as mentioned, capped the save slots the player can see at just 1 by a small "DataManager.maxSavefiles = function() { return 1; };" plugin. In theory, File 99 IS highlighted, the player can just not see it because the file itself is not visible (File 1 is not highlighted if the player just presses Space on the load screen). If the player presses down or up, File 1 is highlighted, which is when it also loads File 1 as it should. If there was no autosave after the last manual save, File 1 gets highlighted as well. Everything works as intended there, the file that was last saved is the one that gets automatically highlighted when opening up the load screen, it just so happens that I made File 99 invisible.
Try this.
Code:
Scene_Load.prototype.firstSavefileIndex = function() {
    return 0;
};

That should make it highlight the first available save file instead of the most recent.

Paste that into a text editor, save as a *.js file, include as a plugin.
Hi.

Below code probably does what you wanted. Not tested though.

JavaScript:
let base_StorageManager_load = StorageManager.load;
StorageManager.load = function(savefileId) {
    if (savefileId === 99) savefileId = 1;
    base_StorageManager_load.call(this, savefileId);
}

Good luck.
This doesn't sound like good plugin behavior. There really shouldn't be a situation where the player can load data that is supposed to be system related.
Try this.
Code:
Scene_Load.prototype.firstSavefileIndex = function() {
    return 0;
};

That should make it highlight the first available save file instead of the most recent.

Paste that into a text editor, save as a *.js file, include as a plugin.
This works like a charm, thank you! Even easier than making it load a different file.

Thanks @rakanishoo for your work as well! Have a good day, both of you ^_^
This thread is being closed due to being solved. If you do find you need it later, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/solved-prevent-specific-save-file-from-being-loaded.159213/