Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[RGSS3]Rescuing from the main loop.

Hey guys,

I've been experimenting with RGSS3 a lot recently but I came across an annoyance that I never had on previous RGSS versions.
I can't seem to rescue any exceptions from the main loop.

Back on RGSS1 and 2 my code would have looked like that:
Code:
 

begin

 # main loop code here...

rescue Exception =­­> error

 # my custom error handling here...

rescue Errno::ENOENT

 # the usual ENOENT error handling here

end

 

On RGSS3, this code doesn't work. I tried the following to no avail:
Code:
 

rgss_main {

begin

 SceneManager.run

rescue Exception =­­> error

 # my custom error handling here...

end

}

 

I have also tried to add my begin/rescue clauses in the SceneManager.run method; still nothing.
Any idea on how I could make this work on RGSS3? I really have no clue why it doesn't work.

EDIT:
After more testing, I can rescue built-in exceptions, including RGSSReset, but I can't rescue SystemExit. Why?? O_o

Thanks,
- Dargor
 
I don't know exactly how exceptions are stored in Ruby, and it's obviously something RGSS3 handles diffierently, but have you tried creating an instance of the SystemExit exception to see if it truly exists in the library? As I don't see why RGSS3 would prevent a rescue of a raised SystemExit exception, since it's just a library, not a wrapper, right?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top