Load save while in game?

I have a common event function alternative to the standard 'game over' command in RPG Maker VX Ace. In the CE, it shows the Game Over screen, plays some music, displays some text, and then gives the user a few options. First off, they can Exit to Title (Got that covered), Quit the game (Got that covered), or load from last save. How would I load from last save while in the game? I have done a few google searches and no questions are like this.


Thank you very much in advance c:
I've moved this thread to VX Ace Support (this is not a discussion of a game mechanic). Please be sure to post your threads in the correct forum next time. Thank you.


Try this as a script call:

Code:
DataManager.load_game(DataManager.latest_savefile_index)
I've moved this thread to VX Ace Support (this is not a discussion of a game mechanic). Please be sure to post your threads in the correct forum next time. Thank you.


Try this as a script call:



DataManager.load_game(DataManager.latest_savefile_index)



I tried adding this, but all it did was sort of freeze my game's picture in a way. Oddly enough, I was able to walk around but the screen was frozen. Any ideas why this is happening?
you should delete the pictures before you do the script call.


Also add this after that command:

Code:
$game_system.on_after_load
Still not working, am I doing this right?
 

@>Erase Picture 2


@>Script: DataManager.load_game(DataManager.latest_savefile_index)
     :         :$game_system.on_after_load



Thank you for the very helpful replies, by the way 🙂 I apologize for posting in the wrong thread.
add a wait after erasing the picture.


Are you using any plugins that would affect the map display or picture?
add a wait after erasing the picture.


Are you using any plugins that would affect the map display or picture?

Ok I will try that when I get home and tell you the results 🙂


As of right now, no. I am not aware of any plugins that may be distorting my screen
Kirby~, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Just edit your post to add new info.  If you must quote other people, use the multiquote button.
Ok, I did as you said. I added a wait after the Erase Picture sequence to see if it did anything, unfortunately, it did not. My exact code is as follows now:


(I will be showing the full code now to see if there is any discrepancies in my whole Common Event in general.)

@>Fadeout Screen


@>Show Picture: 2, 'Gameover', Upper Left (0,0), (65%,65%), 255, Normal


@>Fadein Screen


@>Play SE: 'gameover-bit', 100, 100


@>Text: -, -, Normal, Bottom
:           : \n<PLAYERNAMEHERE>Oh dear, it looks like I am dead.
:           : What should we do now?
@>Show Choices: Title Screen, Last Save, Quit
:  When [Title Screen]


   @>Return to Title Screen
   @>


:  When [Last Save]


   @>Erase Picture: 1
   @>Erase Picture: 2
   @>Wait: 60 frame(s)                     (< what you suggested earlier)
   @>Script: DataManager.load_game(DataManager.latest_savefile_index)


    :             : $game_system.on_after_load


   @>


:  When [Quit]


   @>Script: SceneManager.exit
   @>
:  Branch End
@>



-In the code, I have inserted 'PLAYERNAMEHERE' so as to not reveal all the  details to my game in general.


-Also, \n<> is a command in the Yanfly Ace Message System, which is a script I have installed in my game.


-The scripts I have installed in my game are:


>Yanfly Ace Message System,


>Yanfly Ace Core Engine


>Yanfly Ace Debug Extension


>And the TDS Splash Screen script. This displays my logo and info before the title screen starts.



Regarding my previous mistakes, I have now fully read the forum rules, and will make sure my posts are now in check with forum quota. 😀 Thank You!
What exactly is happening?  Does the saved game load, and do you go to the correct place?  Is it just an issue with the picture?  Can you show a screenshot of what it looks like before you activate this event, and what it looks like after?


As a test, disable all of the custom scripts you've added, and play the game.  See if it works without the scripts.  That'll tell us whether it's just the design of the event or a conflict with a script that's causing the issue.  Let me know what the results are.


Edit - sorry for the mod text, which I've removed - because you 'voted' on a post, it started showing me the thread with all the posts mixed up, and it looked like you were double posting, when you weren't.  I wish there was a setting where we could override this.
I disabled all of the scripts in my game, and tried it again. But the issue remained.


Here's pretty much what is happening:


Step 1: The player activates a touch trigger that turns on some music and the enemy comes running down the hallway.


(Shown in Capture.PNG)


Capture.PNG


Step 2: If the enemy catches the player, it triggers a Game Over Common Event, the one we have been talking about here.


            The player then can select 3 options. If he selects Last Save, the intention is for the person to go back to their last saved point.


(Shown in Capture1.PNG)


Capture1.PNG


Step 3: (THE BUG) When the player selects 'Last Save,' it takes away the picture and the dialog, but the part when the enemy is still touching


            the player (the game over Common Event trigger) is still there. I can move around with the player and activate the first touch trigger all over


            again showing that your code did work, but the screen will not update, and will still show the enemy right there with the player.


(This is all shown in Capture2.PNG)


Capture2.PNG
I think the problem is most likely with the Common Event not stopping processing when I call the load save code Shaz gave me. Does anyone else know of any other script add on that will implement this feature?

Original thread: https://forums.rpgmakerweb.com/threads/load-save-while-in-game.57035/