Hello everyone! (it's me again, still struggling on the same menu for my project 😅)
I'm trying to create a save/load menu using common events, and I'm having problems with the script command part.
I've tried using the commands suggested by forum users, and from the list of script commands, but I'm running into problems in both cases and have no idea how to solve them.
I'm using RPG Maker MZ 1.7.0.
Case 1)
Used commands
Save:
Load:
Issue:
Everything seems to be fine when I save, but the main character is invisible when I load the game.
Case 2)
Used commands
Save:
Load:
Issue:
If I try to save or load, I have an error message:
Here's a quick link to the script call list.
I don't have enough knowledge in JS to know what is the issue. Can you help me?
Thank you for reading!
I'm trying to create a save/load menu using common events, and I'm having problems with the script command part.
I've tried using the commands suggested by forum users, and from the list of script commands, but I'm running into problems in both cases and have no idea how to solve them.
I'm using RPG Maker MZ 1.7.0.
Case 1)
Used commands
Save:
Code:
$gameSystem.setSavefileId(1);
$gameSystem.onBeforeSave();
Load:
Code:
DataManager.loadGame(1);
Issue:
Everything seems to be fine when I save, but the main character is invisible when I load the game.
Case 2)
Used commands
Save:
Code:
$gameSystem.setSavefileId(1);
$gameSystem.onBeforeSave();
await DataManager.saveGame(1);
Load:
Code:
await DataManager.loadGame(1)
.then(() => {
SoundManager.playLoad();
SceneManager._scene.fadeOutAll();
if ($gameSystem.versionId() !== $dataSystem.versionId) {
const p = $gamePlayer;
p.reserveTransfer($gameMap.mapId(), p.x, p.y, p.direction(), 0);
p.requestMapReload();
}
SceneManager.goto(Scene_Map);
$gameSystem.onAfterLoad();
}).catch(() => SoundManager.playBuzzer());
Issue:
If I try to save or load, I have an error message:
SyntaxError
await is only valid in async function
await is only valid in async function
Here's a quick link to the script call list.
I don't have enough knowledge in JS to know what is the issue. Can you help me?
Thank you for reading!