Cache error when using Attack Command with the actors?

I'm not pretty sure what happened. I don't know since when this could be happening as I was testing a lot of things without attacking for several time.
When I use the attack command with the actor it returns this error:
1693083507206.png

But this doesn't happen when an enemy is the one attacking.
Is possible some script is looping the attack command on the class actor until the cache makes the game crash? Is the only thing I can think of.
Please post the backtrace as well.
Please post the backtrace as well.
You mean the line related? If that's the case:

Ruby:
  #--------------------------------------------------------------------------
  # * Create/Get Normal Bitmap
  #--------------------------------------------------------------------------
  def self.normal_bitmap(path)
    @cache[path] = Bitmap.new(path) unless include?(path)
    @cache[path]
  end
Backtrace, not the code. As you know, the backtrace tells us the path the interpreter had walked through during your game's execution till the moment it crashed. That's what I'd need to get here.
I'm sorry. I don't know where could I get that. Its supposed to be in the console? Cuz my console always appear all black, doesn't show me anything.

EDIT: Okay, I googled Backtrace for vx ace on google and found out a script that finally show me the erros in the console! Here it is:

1693089298633.png
Yeah, that's an actual backtrace but I'm getting the feeling it's missing a couple of lines there. It couldn't just end in Yanfly's BattleEngine#update method. Because you took a screenshot of the console window, it skipped a couple of lines at the very beginning.

Why don't you include the following scriplet in the backtrace script you found online:

Ruby:
  error = $!
  File.open("error.log", "w") {|f| f.puts error.message, error.backtrace.reverse }

Please include that code below the rescue call, it'd look something like this:

Ruby:
  rescue # Probably Some Variables Here #
    # Some Other Code Here #
    error = $!
    File.open("error.txt", "w") {|f| f.puts error.message, error.backtrace.reverse }
  end

That should create a file called error.txt there. Please post the contents of that file here.
I'm not sure if a txt file should be created in the folder of my game, but for now that's not the case.
I'm using this backtrace script
There's severals instances called "rescue" and I'm not sure where should I put that scriplet. Sorry, I'm kind of dumb for these kind of things.
The script you linked to already has an option to create a file - right in the configuration at the top, it says to set LOG_EXCEPTIONS to true then you can upload the backtrace.log it makes in your project directory.
The script you linked to already has an option to create a file - right in the configuration at the top, it says to set LOG_EXCEPTIONS to true then you can upload the backtrace.log it makes in your project directory.
Lol... I feel so dumb. Thank you! Here it is:
Code:
2023-08-26 21:59:48 -0300 >> EXCEPTION CAUGHT <<
RGSSError: failed to create bitmap.
Backtrace:
    Cache:106:in `initialize'
    Cache:106:in `new'
    Cache:106:in `normal_bitmap'
    Cache:91:in `load_bitmap'
    Cache:15:in `animation'
    Sprite_Base:73:in `load_animation_bitmap'
    Sprite_Base:54:in `start_animation'
    Sprite_Battler:145:in `setup_new_animation'
    Yanfly Core Engine:577:in `setup_new_animation'
    Sprite_Battler:43:in `update'
    Enemy Bar:61:in `update'
    Spriteset_Battle:333:in `block in update_enemies'
    Spriteset_Battle:333:in `each'
    Spriteset_Battle:333:in `update_enemies'
    Spriteset_Battle:311:in `update'
    MOG_Battle_Cursor:329:in `update'
    MOG_Weather_EX:626:in `update'
    Scene_Battle:59:in `update_basic'
    Yanfly BattleEngine:2587:in `update_basic'
    MOG_Battle_Command_EX:345:in `update_basic'
    Yanfly Input Combo:731:in `update_basic'
    Scene_Battle:67:in `update_for_wait'
    Scene_Battle:104:in `wait_for_animation'
    Yanfly BattleEngine:3051:in `show_attack_animation'
    Scene_Battle:654:in `show_animation'
    Yanfly BattleEngine:3099:in `use_item'
    Yanfly Random Skill:160:in `use_item'
    Get Battle info:205:in `use_item'
    Yanfly Input Combo:644:in `use_item'
    Common event before skill:15:in `use_item'
    CARDGAME SKILL:2305:in `use_item'
    Yanfly BattleEngine:3001:in `execute_action'
    Yanfly Lunatic State:1086:in `execute_action'
    Yanfly Instant Cast:303:in `execute_action'
    Yanfly Combat Log:489:in `execute_action'
    CARDGAME SKILL:2214:in `perform_action'
    CARDGAME SKILL:2174:in `next_command'
    Yanfly Battle Commands:1001:in `next_command'
    Scene_Battle:408:in `on_enemy_ok'
    Yanfly BattleEngine:2926:in `on_enemy_ok'
    Yanfly Battle Commands:904:in `on_enemy_ok'
    Venka's Bestiary v1.8:1717:in `on_enemy_ok'
    Window_Selectable:212:in `call'
    Window_Selectable:212:in `call_handler'
    Window_Selectable:331:in `call_ok_handler'
    Window_Selectable:322:in `process_ok'
    MOG_Battle_Cursor:621:in `process_ok'
    Window_Selectable:297:in `process_handling'
    (Add-On) Yanfly Target Manager:251:in `process_handling'
    Window_Selectable:276:in `update'
    Yanfly BattleEngine:2234:in `update'
    MOG_Battle_Cursor:554:in `update'
    Scene_Base:95:in `block in update_all_windows'
    Scene_Base:93:in `each'
    Scene_Base:93:in `update_all_windows'
    Scene_Base:49:in `update_basic'
    Scene_Battle:56:in `update_basic'
    Yanfly BattleEngine:2587:in `update_basic'
    MOG_Battle_Command_EX:345:in `update_basic'
    Yanfly Input Combo:731:in `update_basic'
    Scene_Base:41:in `update'
    Hime Common Event in Scene:187:in `update'
    Hime Scene Event Animation:170:in `update'
    Scene_Battle:45:in `update'
    Hime End Phase:91:in `update'
    Venka's Bestiary v1.8:1742:in `update'
    Scene_Base:14:in `main'
    MOG_Weather_EX:672:in `main'
    SceneManager:23:in `run'
    Hime Common Event in Scene:117:in `run'
    Main:13:in `block in <main>'
    :1:in `block in rgss_main'
    :1:in `loop'
    :1:in `rgss_main'
    Backtrace:243:in `block in rgss_main'
    Backtrace:99:in `with_exception_handling'
    Backtrace:242:in `rgss_main'
    Main:13:in `<main>'
    ruby:in `eval'
It looks like the error was about loading the animation image.
Honestly, when an error like this happens, the most helpful thing you can do is to figure out which file that causes the problem. I'm pretty sure I wrote about this somewhere but I can't find it.

Anyway, this is probably more helpful than backtrace.
Code:
module Cache
  def self.normal_bitmap(path)
    begin
      @cache[path] = Bitmap.new(path) unless include?(path)
      @cache[path]
    rescue
      msgbox_p "Failed to load image #{path}"
      @cache[path] = Bitmap.new(1,1)
      @cache[path]
    end
  end
end
This will directly give you which file causes the problem without crashing the game in the process.
Actually, I disagree with @TheoAllen. The backtrace + @Mattsuharu 's initial description of the problem already tell us a lot about what's happening there.

You see, Mattsuharu chooses to attack the enemy physically. Every animation is supposed to have 1 or 2 animation sets to display on the target. Normal attack's animation is botched for an unknown reason because it can't even find the first set.
Seems like some of the files were corrupted because I have my game in my one drive to work on it on different PC's. I copied and pasted some graphics from the RTP and it got fixed. I think I should stop having the game on my one drive... Thanks for the help guys!
Seems like some of the files were corrupted because I have my game in my one drive to work on it on different PC's. I copied and pasted some graphics from the RTP and it got fixed. I think I should stop having the game on my one drive... Thanks for the help guys!
I would definitely recommend against editing a game project directly from the cloud. Make changes locally and upload the new version to OneDrive when you're done.

Original thread: https://forums.rpgmakerweb.com/threads/cache-error-when-using-attack-command-with-the-actors.160658/