Is there a way to load a game via event? (Continue After Defeat)

Diretooth

Lv. 25 Werewolf
Veteran
Joined
Mar 10, 2013
Messages
1,231
Reaction score
445
First Language
English
Primarily Uses
RMMV
Allow me to preface this with, I know how to use scripting to save a game with
Code:
$gameSystem.onBeforeSave();
DataManager.saveGame(1);
I actually do use this to restrict player saving to a save point and a key item (The save point saves to slot 1, the item saves to slot 2. This keeps the game from being unwinnable due to player error.)
I want to implement a checkpoint system into the game where a checkpoint is placed before a boss fight that can end in game over, (therefore skipping most of a cutscene and just getting to the fight,) and thus to streamline the process, I need a script call that would allow me to load a save slot (saving the player a few extra key presses by having them answer yes on 'Do you wish to continue?').
On this note, would it also be possible to, via script call, delete a save file?
Thank you for your consideration and your time.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
955
Reaction score
528
First Language
Javascript
Primarily Uses
RMMZ
... load/delete a save file?
Load Save:
Code:
var saveId = 1; if (DataManager.loadGame(saveId)) {SceneManager._scene.fadeOutAll();if ($gameSystem.versionId() !== $dataSystem.versionId) {$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);$gamePlayer.requestMapReload();}SceneManager.goto(Scene_Map);}
Delete Save:
Code:
var saveId = 1; StorageManager.remove(saveId);
 
Last edited:

Diretooth

Lv. 25 Werewolf
Veteran
Joined
Mar 10, 2013
Messages
1,231
Reaction score
445
First Language
English
Primarily Uses
RMMV
Doing some quick testing with a test project, and it all works perfectly from what little I did.
Notes: Saving mid-cutscene keeps the positions of the events at that time upon load. Loading a save, whether manual or by script, shows no issue with mid-cutscene actions. Deleting a save does not result in any save file corruption. Therefore, this achieves exactly what I needed. Thank you, @ct_bolt, for the help.

EDIT: I was doing a little playing around with Yanfly's Save Core plugin. While it is an easily resolved issue, if you create a save on a slot that doesn't exist (by way of reducing the max number of save slots), and then delete it, it will cause the game to crash. If you use this in conjunction with a plugin that reduces the number of save slots, don't save to a file that doesn't exist and then delete it.
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
955
Reaction score
528
First Language
Javascript
Primarily Uses
RMMZ
Doing some quick testing with a test project, and it all works perfectly from what little I did.
Notes: Saving mid-cutscene keeps the positions of the events at that time upon load. Loading a save, whether manual or by script, shows no issue with mid-cutscene actions. Deleting a save does not result in any save file corruption. Therefore, this achieves exactly what I needed. Thank you, @ct_bolt, for the help.
Yay! Glad to hear it! Happy Game Making!!!
EDIT: I was doing a little playing around with Yanfly's Save Core plugin. While it is an easily resolved issue, if you create a save on a slot that doesn't exist (by way of reducing the max number of save slots), and then delete it, it will cause the game to crash. If you use this in conjunction with a plugin that reduces the number of save slots, don't save to a file that doesn't exist and then delete it.
Ahh interesting good to know, maybe I'll look into that also :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Nearing completion of the first major city of Albert, a vacation getaway city built a long time ago by a king who really didn't want to be invaded.
It’s definitely a great day to fit in some time for me to play no mans sky on PS4
Julyon.png

First concept art of one of our main characters love interest who might turn evil depending on her decisions. Or become king of the world. Or marry her. Maybe even everything at once.
Me: *saved the game*
Also me: *exit the game afterward*
The game: "Any unsaved progress will be lost"
Me: "uh,.. alright?"
[I feel a bit sad I did this]
"WhY?...WhY dId YoU KiLl ThEm AlL?...yOu BlOoDy HeLl MoNsTeR...I'LL MAKE YOU PAY!!! FOR THE BLOOD OF THE LOST!!!" ~Scars final words before his final battle [not final boss]

Battle Theme: Blood of the Lost
Face Sprite
Forgotten Eclipse_Scar Dead+Final Battle with him.png

Forum statistics

Threads
110,269
Messages
1,051,835
Members
143,291
Latest member
FoGGick855
Top