"Failed to create Bitmap" ???

So first things first I use these scripts:
https://atelierrgss.wordpress.com/scripts/rpg-maker-vx-ace/ <--- Basically all of those scripts
Faces to bust script by Formar0153
And a script that allows me to have global switches/variables By theLEECH


My problem is. The game works perfectly when I test it, but when I compress it, then uncompress it and try to run it, it crashes and shows me this error:

"Script 'Cache' line 106: RGSSError occured.
failed to create bitmap"
upload_2018-11-12_14-39-41.png

😠

So my questions are:
  • What am I doing wrong?
  • Is it a script that's causing the error or something else (Hopefully not something beyond my control😅)
  • Should I skip compressing my game into encrypted mode altogether and just make it a .zip file?
  • And if so, what are the risks of that?😢

Your help would be greatly appreciated since I've been working on this game for three years and I don't want it to end like this. 😩
the error itself is not that error, but the instruction that *leads* to that error.
Cache:106 is basically "retrieve this bitmap from the cache"
it is failing to do just that: retrieve the bitmap..... the question is, which actual bitmap? what's the name? where is it? who's calling it?.

there are a number of debugging plugins you can try to retrieve the actual instruction, but I can't remember how they're called.
look into the finished plugins section, by "console dump" or "stack trace" plugins.

I've moved this thread to RGSSx Script Support. Thank you.

the error itself is not that error, but the instruction that *leads* to that error.
Cache:106 is basically "retrieve this bitmap from the cache"
it is failing to do just that: retrieve the bitmap..... the question is, which actual bitmap? what's the name? where is it? who's calling it?.

Well this is a problem. As I mentioned earlier: when I playtest the game it works just fine. It only crashes after I compress it with the standard rpgmaker compressor. I don't want to download a debug plugin and then have to export the game time and time again to find out what's causing the bug. Exporting the game takes time as it is.

Will I have a problem if instead of compressing the files, I just turned them into a zip?
you don't have to export the game again and again..... just once.
the one time where it'll dump the error and produce a log.
that's how you find the error.
you don't have to export the game again and again..... just once.
the one time where it'll dump the error and produce a log.
that's how you find the error.
Okay, I'll try that. Thanks for the help.
Fingers crossed it will work. 😅
Code:
module Cache
  def self.normal_bitmap(path)
    p path
    @cache[path] = Bitmap.new(path) unless include?(path)
    @cache[path]
  end
end
Yeah just print the path on the console to see "which bitmap". If you want to enable console using Game.exe, might as well as put this.
***PROGRESS UPDATE***

Turns out that by using the RPGMaker compressor all the extra files that the MOG script is using do not get exported along with the rest of my game. I guess I should just zip the whole thing and export it manually when it's done. There is no way around this.
all the extra files that the MOG script is using

if the files are within the game folder and correctly referenced, they should be compressed as well 😳
Yeah. Moggy usually puts all his graphics in default folders like the Graphics\Pictures folder. He's been like that since RMXP and it looks like he still does that. I personally write tweaks to add new folders to store my graphics and keep my custom menu graphics separate. But Mog tends to use the same default folders.

Question. Did you garner this Mog script from a demo? And if it was from a demo, have you tried compressing the demo itself to see if it happens there too? (Okay, that was two questions.)
if the files are within the game folder and correctly referenced, they should be compressed as well 😳
Did I write files? Sorry, I meant folders. 😅 You see the MOG script has those custom folders (like Gallery, Music Room etc) and I suspect this is what's causing the problem.

Yeah. Moggy usually puts all his graphics in default folders like the Graphics\Pictures folder. He's been like that since RMXP and it looks like he still does that. I personally write tweaks to add new folders to store my graphics and keep my custom menu graphics separate. But Mog tends to use the same default folders.

Question. Did you garner this Mog script from a demo? And if it was from a demo, have you tried compressing the demo itself to see if it happens there too? (Okay, that was two questions.)

Hmmmm You know what? This is a VERY good idea! I'll try this and see if it works. Because from what I remember the Demo didn't come compressed.
the compressor will pack everything that is within the game folder.
I don't know how you can get "missing file" errors if everything is where it's supposed to be.
I tried compressing the MOG demo and it works just fine. Guess it wasn't the problem after all. But if I can't use the debug console after I compress the game, and the error wasn't coming from the extra folders not being exported then what can I do?😩
You might want to read this:
https://forums.rpgmakerweb.com/index.php?threads/ace-script-error-when-game-encrypted.15484/

The topic is about the same issue you have, and may be related.
Did you include the file extensions in your image file settings? If so, remove those file extensions and try again.
Also, if you have two image files with the same name but different file extension, either rename or delete one.
No idea if this is what happens to your project, but it's worth a try, I guess.

If this doesn't help, there should be a script around that enables the console even when the game is run with the Game.exe file.
Install that script, and check which file breaks the game.
I don't remember where that script is, but it's there somewhere, so search for it. 😛
If this doesn't help, there should be a script around that enables the console even when the game is run with the Game.exe file.
Install that script, and check which file breaks the game.
I don't remember where that script is, but it's there somewhere, so search for it. 😛
I'm just gonna put this here https://github.com/theoallen/RGSS3/blob/master/Backup/Enable Console.rb
Forgot the source, but better than being lost.
replace the "SceneManager.run" instruction with
Spoiler: THIS CHUNK OF CODE
Code:
def report_exception(error)
  scripts_name = load_data('Data/Scripts.rvdata2')
  scripts_name.collect! {|script|  script[1]  }
  backtrace = []
  error.backtrace.each_with_index {|line,i|
    if line =~ /{(.*)}(.*)/
      backtrace << (scripts_name[$1.to_i] + $2)
    elsif line.start_with?(':1:')
      break
    else
      backtrace << line
    end
  }
  error_line = backtrace.first
  backtrace[0] = ''
  err_class = " (#{error.class})"
  back_trace_txt = backtrace.join("\n\tfrom ")
  error_txt = sprintf("%s %s %s %s %s %s",error_line, ": ", error.message, err_class, back_trace_txt, "\n" )
  print error_txt
  return error_txt
end
begin
  rgss_main do
    begin
      SceneManager.run
    end
  end
rescue SystemExit
  exit
rescue Exception => error
  error_txt = report_exception(error)
  print "Submit the file \"ErrorLog.txt\" in your project folder to the upper most script creators noted in the message.\n"
 
  filename = "ErrorLog.txt"
 
  File.open(filename, 'w+') {|f| f.write(error_txt + "\n") }
  raise  error.class, error.message, [error.backtrace.first]
end

set the program so that it fails, and recompile

that should dump the error backtrace and detail what's causing it.
I don't know who wrote that.... I've had it for a while now, and it works.
You might want to read this:
https://forums.rpgmakerweb.com/index.php?threads/ace-script-error-when-game-encrypted.15484/

The topic is about the same issue you have, and may be related.
Did you include the file extensions in your image file settings? If so, remove those file extensions and try again.
Also, if you have two image files with the same name but different file extension, either rename or delete one.
No idea if this is what happens to your project, but it's worth a try, I guess.

If this doesn't help, there should be a script around that enables the console even when the game is run with the Game.exe file.
Install that script, and check which file breaks the game.
I don't remember where that script is, but it's there somewhere, so search for it. 😛

Thank you thank you thank you!!!😢 This was EXACTLY the problem! I fixed it and I can now compress the game and it will launch normally!🙏 I am so grateful!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/failed-to-create-bitmap.102063/