Hey,
I'm working on a game with RPGMaker MZ and have a custom title screen in the form of a converted Map1. There I have 2 choices: New Game and Continue. If i go to new game i get to map2, the first playable map. if i save on map2 and go back to the custom titlescreen, i can click on continue and it works as it should. but if i don't stay on map2 but go to map3 and save there and then go back to my titlescreen to click on continue, i get "TypeError cannot read property 'pages' of undefined". The same happens if I saved in map 1 but then quit the game completely and restart it and then go to continue playing.
To save I use either the normal save function per event of the RMMZ or a save script per event:
$gameSystem.onBeforeSave();
DataManager.saveGame(1);
To load:
if (DataManager.loadGame(1)) {
SoundManager.playLoad();
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
SceneManager.goto(Scene_Map);
$gameSystem.onAfterLoad();
}
strangely, loading with a try catch block around it works better, but still buggy, like the music of the title screen plays instead of the bgm of the map that was loaded.
Basically I want to have only one savegame in my game, which the player always overwrites when saving and can continue in the title screen, unless he wants to start a new game.
I hope someone can help me, thank you very much!
I'm working on a game with RPGMaker MZ and have a custom title screen in the form of a converted Map1. There I have 2 choices: New Game and Continue. If i go to new game i get to map2, the first playable map. if i save on map2 and go back to the custom titlescreen, i can click on continue and it works as it should. but if i don't stay on map2 but go to map3 and save there and then go back to my titlescreen to click on continue, i get "TypeError cannot read property 'pages' of undefined". The same happens if I saved in map 1 but then quit the game completely and restart it and then go to continue playing.
To save I use either the normal save function per event of the RMMZ or a save script per event:
$gameSystem.onBeforeSave();
DataManager.saveGame(1);
To load:
if (DataManager.loadGame(1)) {
SoundManager.playLoad();
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
SceneManager.goto(Scene_Map);
$gameSystem.onAfterLoad();
}
strangely, loading with a try catch block around it works better, but still buggy, like the music of the title screen plays instead of the bgm of the map that was loaded.
Basically I want to have only one savegame in my game, which the player always overwrites when saving and can continue in the title screen, unless he wants to start a new game.
I hope someone can help me, thank you very much!