I have a game which, some of the time, *will* error, due to a network connection.
I have added to main this:
I want, instead of showing an alert as usual saying there has been an error, to send the player to a scene which shows a nicely printed message. I've called this Scene_Error.
The problem is that while this successfully stops the error message, the game closes after the error anyway. I think RMXP is merely programmed to do this (print error then close).
Can I suppress this close so that I can display my scene?
Nothing will be shown in this scene other than a window with some text in (from e.message).
Here is my scene if it's needed:
I have added to main this:
begin
# blah blah main script
rescue Exception => e
$scene = Scene_Error.new(e.message)
end
I want, instead of showing an alert as usual saying there has been an error, to send the player to a scene which shows a nicely printed message. I've called this Scene_Error.
The problem is that while this successfully stops the error message, the game closes after the error anyway. I think RMXP is merely programmed to do this (print error then close).
Can I suppress this close so that I can display my scene?
Nothing will be shown in this scene other than a window with some text in (from e.message).
Here is my scene if it's needed:
- class Scene_Error
- def initialize(message)
- @message = message
- end
- def main
- @help_window = Window_Help.new
- @help_window.set_text(@message)
- @help_window.y = 288
- Graphics.transition
- loop do
- Graphics.update
- @help_window.update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @help_window.dispose
- end
- end
Expand to see the code.