03-06-2008, 06:00 AM
If a save file has become corrupted or something else causes the load process to fail you can use this script to display the error and allow the player to select another save.
You need my Dialog System. (Only the system, not the yes/no dialog present in that topic)
You also need this ok dialog
Then its just to insert this script somewhere above main and below Dialog_Ok
Note that this will not prevent errors from crashing the game if Window_SaveFile fails to read the little portion of the save file it needs.
*hugs*
- Zeriab
You need my Dialog System. (Only the system, not the yes/no dialog present in that topic)
You also need this ok dialog
Dialog_Ok
Then its just to insert this script somewhere above main and below Dialog_Ok
Code:
# Error message on corrupt files
# by Zeriab
# Requires Dialog System and Dialog_Ok
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
unless self.method_defined?(:zeriab_load_on_decision)
alias zeriab_load_on_decision on_decision
end
def on_decision(filename)
begin
# The original call
zeriab_load_on_decision(filename)
rescue Exception => error
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
# Show error message
Dialog_Ok.show(error.message)
end
end
end
*hugs*
- Zeriab