Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Load file error dialog
#1
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
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
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
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   SLOLS: Snake Look-alike on Load Script Zeriab 3 10,709 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo
   Moghunter Menus: Scene File Ayumi DerVVulfman 4 13,706 07-28-2016, 05:13 PM
Last Post: Djigit
   File Missing Error Preventer xnadvance 0 5,704 05-29-2011, 05:24 AM
Last Post: xnadvance
   Audio File Encryption Dark-Yen 0 5,040 03-08-2008, 06:35 AM
Last Post: Dark-Yen
   Error Log Exsharaen 0 4,441 03-07-2008, 06:53 PM
Last Post: Exsharaen
   Dialog System Zeriab 0 4,405 03-06-2008, 06:03 AM
Last Post: Zeriab
   Loading Data from File Trickster 0 4,926 03-02-2008, 06:04 AM
Last Post: Trickster



Users browsing this thread: