Hi everyone! It's been a while, but I'm back with more questions (because I am very dumb 😅 ). I'm having a very big (very game-breaking) issue that I need help with. Essentially, I'm trying to make a single file save system (because I don't want people going back to fix mistakes they've made). I completely cut out the default title screen and made my own using events. On it, there is an option to start a new game (if you have a save file it becomes "Continue") and an option to exit the game. Everything works perfectly until you try to save for a second time. The first time you save, you can use the "Continue" option to get back to where you were, but the next time you save and try to use "Continue" to get back, it says
The code I'm using to load the save file
if (DataManager.loadGame(1)) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
SceneManager.goto(Scene_Map);
}
The code I'm using to save the game
$gameSystem.onBeforeSave();
if (DataManager.saveGame(1)) {
StorageManager.cleanBackup(1);
}
TypeError
Cannot read property 'name' of undefined
After you get this error you have to completely delete the save file, or else it just keeps doing it. I've already spent close to three hours trying to figure this out on my own, but I just can't. I could really use some help here because I don't know how I'm going to publish this if you can't even save. Can anyone help me with this? I'm going to include my code below just in case it might help.Cannot read property 'name' of undefined
The code I'm using to load the save file
if (DataManager.loadGame(1)) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
SceneManager.goto(Scene_Map);
}
The code I'm using to save the game
$gameSystem.onBeforeSave();
if (DataManager.saveGame(1)) {
StorageManager.cleanBackup(1);
}