[RMVX ACE] AUTO LOAD THE PLAYERS LAST SAVE WHEN THEY DIE
Posts
Pages:
1
Heyo, I'm looking for a script that automatically loads the players last save when they get a game over, instead of taking them back to the title screen. I've searched around a bit for something like this, but to no avail. Anyone know of anything?
I think something like...
...this might do it?
class Scene_Gameover < Scene_Base def goto_title fadeout_all index = DataManager.latest_savefile_index if DataManager.load_game(index) on_load_success else SceneManager.goto(Scene_Title) end end def on_load_success $game_system.on_after_load SceneManager.goto(Scene_Map) end end
...this might do it?
You can use this:
DataManager.latest_savefile_index should get the index of the latest save file.
EDIT: Whops, forgot you wanted it in the gameover screen. So yeah, you should put this in the gameover class. Marrend's solution should work.^^
if DataManager.load_game(DataManager.latest_savefile_index)
$game_system.on_after_load
SceneManager.goto(Scene_Map) #IF LOAD SUCCESSFUL
else
#DO SOMETHING ELSE IF YOU CAN'T LOAD THE GAME FROM GIVEN INDEX
end
DataManager.latest_savefile_index should get the index of the latest save file.
EDIT: Whops, forgot you wanted it in the gameover screen. So yeah, you should put this in the gameover class. Marrend's solution should work.^^
author=Marrend
I think something like...
class Scene_Gameover < Scene_Base def goto_title fadeout_all index = DataManager.latest_savefile_index if DataManager.load_game(index) on_load_success else SceneManager.goto(Scene_Title) end end def on_load_success $game_system.on_after_load SceneManager.goto(Scene_Map) end end
...this might do it?
That works great, thank you so much!
author=OldPat
You can use this:if DataManager.load_game(DataManager.latest_savefile_index)
$game_system.on_after_load
SceneManager.goto(Scene_Map) #IF LOAD SUCCESSFUL
else
#DO SOMETHING ELSE IF YOU CAN'T LOAD THE GAME FROM GIVEN INDEX
end
DataManager.latest_savefile_index should get the index of the latest save file.
EDIT: Whops, forgot you wanted it in the gameover screen. So yeah, you should put this in the gameover class. Marrend's solution should work.^^
Heh, thanks, I appreciate it! ^-^;
Other options on battle end using common events:
http://www.rpgmakercentral.com/topic/16399-common-event-on-battle-end/
Pages:
1















