Check Save Data Switch?

Hello! New forum user here.

I'm making a game that uses event-based menus for saving/loading data, and I want to know if there is some kind of script call that checks if switches are on/off within save data. This is so that I can have different pictures for the save slots so that the player can differentiate the saves, such as if one save file is on normal difficulty, while the other is on a harder difficulty.

Thanks!
- Shyrx
Welcome to the forums!

Tough call, but I'm going to move this thread over to Learning JavaScript, where I think people will have a lot of knowledge about how the save files are structured.
By default there's no such switch. However, you can implement something like that into the savefile info.
Code:
DataManager.makeSavefileInfo = function() {
    var info = {};
    info.globalId   = this._globalId;
    info.title      = $dataSystem.gameTitle;
    info.characters = $gameParty.charactersForSavefile();
    info.faces      = $gameParty.facesForSavefile();
    info.playtime   = $gameSystem.playtimeText();
    info.timestamp  = Date.now();
    return info;
};
You simply take this funtion (it's in rpg_managers.js) and add something like:
Code:
info.difficulty = $gameSystem._difficulty;
or how you handle difficulty.
Then as you're drawing the window, you use this:
Code:
YourWindow.prototype.drawItem = function (index) {
var sfInfo = DataManager.loadSavefileInfo(index+1);
if (!sfInfo) return;
if (sfInfo.difficulty == 1) drawEasy();
else if (sfInfo.difficulty == 2) this.drawMedium();
else if (sfInfo.difficulty == 3) this.drawHard();

//remaining code
}
@Poryg This is actually not completely true. This can be done by:
Code:
var SaveFileId = 2;
var SwitchId = 1;
JsonEx.parse(StorageManager.load(SaveFileId)).switches.value(SwitchId);

// This puts it inside a current switch
var CurrentSwitch = 1;
$gameSwitches.setValue(CurrentSwitch,JsonEx.parse(StorageManager.load(SaveFileId)).switches.value(SwitchId));
However, Poryg's method is much more elegant and will save you an arm and leg when your save data becomes massive. Nevertheless, Shyrx is looking for a script call, so a script call he will get.
Oh, sorry, I forgot that you use event based menu. 😀
Hey, thanks so much @Adventurer_inc. ! I got it working the way I wanted it to. 😀

Original thread: https://forums.rpgmakerweb.com/threads/check-save-data-switch.111982/