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.

Preventing game close at file-not-found error

Hi,

Is there any script (or is it possible) to prevent game closing when file-not-found error occurs? Some of my beta testers found it's really annoying, esp. when it occurs at the very beginning of the game. I know we should have been more careful when ensuring no files are left behind (I imported only some RTP files to reduce installation size) before any release, but maybe it's a good idea to let the game run while searching for next errors. When a file does not exist, it will be replaced by a default one.

Nevertheless, I think some files are critical and should not be left behind, as animations, autotiles, and so on. Still images (battlers, icons, battlebacks) are tolerable, maybe...

Thanks.
 
don't think there is anything like that available. the older versions would only error out with missing graphics, but rmxp errors out if anything is missing. just be careful and add as you go, best way i think.
 
Hi, maybe you will find the attached code useful. This code tries to load a picture of a character's face and loads an "empty" file if it cannot be found.
The trick is the control structure:

<begin>
do something
<rescue>
do something else if an error occurs
<end>

Code:
module RPG
  module Cache
    def self.face(filename, hue)
      begin
	      self.load_bitmap("Graphics/Faces/", filename, hue)
      rescue 
	      self.load_bitmap("Graphics/Faces/", "", hue)
      end	
    end
  end
end

Basically you should replace the methods which load graphics and sounds in the Cache module with something like that. I'm very busy right now, so this is just a hint. If there is a scripter around who is familiar with exceptions handling, this is the moment to show up.
 
I know there?s a script that makes it like that:

You need 2 files, one audio file in the bgm and one in the picture folder

The script askes at the error, if the file really doesn?t exist.. If it doesn?t exist, it loads this one audiofile for rescueing ( if a audio error appears ).. or that picture ( for every picture or Chara..that?s not in the project ).
 

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