VXAce Critical Hit animation Script?

I would like to be able to make it so that when a critical hit occurs, the flash effect appears for a few seconds with a specific SE, in addition to the “Critical Hit!” graphic appearing at the same time.
I would like to be able to make it so that when a critical hit occurs, the flash effect appears for a few seconds with a specific SE, in addition to the “Critical Hit!” graphic appearing at the same time.
In case anyone is interested...
Here is the GIF that illustrates what I mean:
65-058.gif
Are you using any custom or known battle scripts? Usually some additions might interfere with this type of work, so it's best to let people know what they're working with.
Are you using any custom or known battle scripts? Usually some additions might interfere with this type of work, so it's best to let people know what they're working with.
I have several scripts, but the main battle ones are “Earthbound-ish Battle Core.”
I am also leaving the file here, not only because it is more direct, but also because of the changes it contains.
I would like to be able to make it so that when a critical hit occurs, the flash effect appears for a few seconds with a specific SE, in addition to the “Critical Hit!” graphic appearing at the same time.
Vlue - Critical Flash + Sound Effect v1.3
Along with the Vlue Script (I think it's posted here https://forums.rpgmakerweb.com/threads/critical-effect-add-on-play-animation-on-critical.130372/

You could use yami's pop up script - https://github.com/suppayami/rmvxa-collection/blob/master/Battle%20Damage%20Popup.rb

Then to add an image of the critical - https://github.com/suppayami/rmvxa-collection/blob/master/Battle Damage Popup Image.rb
I have been testing the scripts, but I cannot get the image to appear, even after configuring or changing the names :/

1772845157835.png
1772845186422.png

1772845218700.png

Idk if I'm doing something wrong or not.
I have been testing the scripts, but I cannot get the image to appear, even after configuring or changing the names :/

View attachment 362087View attachment 362088
View attachment 362089
Idk if I'm doing something wrong or not.
1772851390422.png

Try naming it CRITICAL without the exclamation mark. This is how it looks in my game with the same script and it works.
View attachment 362095
Try naming it CRITICAL without the exclamation mark. This is how it looks in my game with the same script and it works.
It still doesn't work :/ (and just in case, I've put the image in Graphics/System)
It still doesn't work :/ (and just in case, I've put the image in Graphics/System)
There might be some incompatibility, but I'll go ahead and look at your scripts with this to see what's going on.

Edit: Is it possible if you can make a simple file with your game that you can share, because I'm missing far too many graphics files for me to test properly.
There might be some incompatibility, but I'll go ahead and look at your scripts with this to see what's going on.

Edit: Is it possible if you can make a simple file with your game that you can share, because I'm missing far too many graphics files for me to test properly.
Sure, Here is the link
Sure, Here is the link
Replace the image add on with this. The reason why it was not working was because if you didn't have one of the missing files, it would skip everything entirely, so it would create blank/invisible popups.
1772862067593.png


Ruby:
$imported = {} if $imported.nil?
$imported["YES-BattlePopupImage"] = true

#==============================================================================
# ■ BattleLuna
#==============================================================================

module BattleLuna
  module Addon
 
    BATTLE_POPUP[:image_setup] = {
      # For numbers, there are some options below.
      :enable_numbers =>  true,
   
      # For words, this script will search for image in Graphics/Systems
      # with name is the word display in default. Config in :word_setting.
      # Will create default text if cannot find image.
      # For example:
      # "MISS" will search for image MISS in Graphics/System
      # If :add_state  => "%s", it will search for image STATENAME
      :enable_words   =>  true,
   
      # Setup for numbers
      :numbers_setup  =>  {
        # Setup images.
        :hp_number_dmg    =>  "Number+",
        :hp_number_heal   =>  "Number-",
        :mp_number_dmg    =>  "MP_Number+",
        :mp_number_heal   =>  "MP_Number-",
        :tp_number_dmg    =>  "MP_Number+",
        :tp_number_heal   =>  "MP_Number-",
        :critical  => "CRITICAL",
     
        # Setup style.
        :spacing          =>  -4,
      },
    } # Basic setting for image
 
  end # Addon
end # BattleLuna

#==============================================================================
# ■ Sprite_PopupLuna
#==============================================================================
if $imported["YES-BattlePopup"]
class Sprite_PopupLuna < Sprite
 
  #--------------------------------------------------------------------------
  # new method: setting_image
  #--------------------------------------------------------------------------
  def setting_image
    BattleLuna::Addon::BATTLE_POPUP[:image_setup]
  end
 
  #--------------------------------------------------------------------------
  # alias method: create_bitmap
  #--------------------------------------------------------------------------
  alias battle_luna_dpip_create_bitmap create_bitmap
  def create_bitmap
    case @rule
    when :hp_dmg, :hp_heal, :mp_dmg, :mp_heal, :tp_dmg, :tp_heal
      if setting_image[:enable_numbers]
        create_image_bitmap
      else
        battle_luna_dpip_create_bitmap
      end
    else
      if setting_image[:enable_words]
        create_word_bitmap
      else
        battle_luna_dpip_create_bitmap
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: create_image_bitmap
  #--------------------------------------------------------------------------
  def create_image_bitmap
    case @rule
    when :hp_dmg;  num_bitmap = setting_image[:numbers_setup][:hp_number_dmg]
    when :mp_dmg;  num_bitmap = setting_image[:numbers_setup][:mp_number_dmg]
    when :tp_dmg;  num_bitmap = setting_image[:numbers_setup][:tp_number_dmg]
    when :hp_heal; num_bitmap = setting_image[:numbers_setup][:hp_number_heal]
    when :mp_heal; num_bitmap = setting_image[:numbers_setup][:mp_number_heal]
    when :tp_heal; num_bitmap = setting_image[:numbers_setup][:tp_number_heal]
    end
    num_bitmap = Cache.system(num_bitmap)
    #---
    bw = Graphics.width
    bh = num_bitmap.height * 2
    bitmap = Bitmap.new(bw, bh)
    #---
    spacing  = setting_image[:numbers_setup][:spacing]
    nwidth   = num_bitmap.width / 10
    nheight  = num_bitmap.height
    ncount   = @data[0].size
    twidth   = ncount * (nwidth + spacing) - spacing
    offset_x = [(bw - twidth) / 2, 0].max
    #---
    (0...ncount).each { |index|
      x = offset_x + index * (nwidth + spacing)
      number = @data[0][index].to_i
      rect   = Rect.new(nwidth * number, 0, nwidth, nheight)
      bitmap.blt(x, 0, num_bitmap, rect)
    }
    bitmap
  end
 
  #--------------------------------------------------------------------------
  # new method: create_word_bitmap
  #--------------------------------------------------------------------------
  def create_word_bitmap

    raw = setting[:word_setting][@rule]
    image_name = (raw && !raw.include?("%s")) ? raw : @data[0].to_s
    begin
      word_bitmap = Cache.system(image_name)
    rescue

      return battle_luna_dpip_create_bitmap
    end

    bw = Graphics.width
    bh = word_bitmap.height
    bitmap = Bitmap.new(bw, bh) 
    offset_x = [(bw - word_bitmap.width) / 2, 0].max
    bitmap.blt(offset_x, 0, word_bitmap, word_bitmap.rect)
    bitmap
  end
 
end # Sprite_PopupLuna
end
Replace the image add on with this. The reason why it was not working was because if you didn't have one of the missing files, it would skip everything entirely, so it would create blank/invisible popups.
View attachment 362102

Ruby:
$imported = {} if $imported.nil?
$imported["YES-BattlePopupImage"] = true

#==============================================================================
# ■ BattleLuna
#==============================================================================

module BattleLuna
  module Addon
 
    BATTLE_POPUP[:image_setup] = {
      # For numbers, there are some options below.
      :enable_numbers =>  true,
   
      # For words, this script will search for image in Graphics/Systems
      # with name is the word display in default. Config in :word_setting.
      # Will create default text if cannot find image.
      # For example:
      # "MISS" will search for image MISS in Graphics/System
      # If :add_state  => "%s", it will search for image STATENAME
      :enable_words   =>  true,
   
      # Setup for numbers
      :numbers_setup  =>  {
        # Setup images.
        :hp_number_dmg    =>  "Number+",
        :hp_number_heal   =>  "Number-",
        :mp_number_dmg    =>  "MP_Number+",
        :mp_number_heal   =>  "MP_Number-",
        :tp_number_dmg    =>  "MP_Number+",
        :tp_number_heal   =>  "MP_Number-",
        :critical  => "CRITICAL",
     
        # Setup style.
        :spacing          =>  -4,
      },
    } # Basic setting for image
 
  end # Addon
end # BattleLuna

#==============================================================================
# ■ Sprite_PopupLuna
#==============================================================================
if $imported["YES-BattlePopup"]
class Sprite_PopupLuna < Sprite
 
  #--------------------------------------------------------------------------
  # new method: setting_image
  #--------------------------------------------------------------------------
  def setting_image
    BattleLuna::Addon::BATTLE_POPUP[:image_setup]
  end
 
  #--------------------------------------------------------------------------
  # alias method: create_bitmap
  #--------------------------------------------------------------------------
  alias battle_luna_dpip_create_bitmap create_bitmap
  def create_bitmap
    case @rule
    when :hp_dmg, :hp_heal, :mp_dmg, :mp_heal, :tp_dmg, :tp_heal
      if setting_image[:enable_numbers]
        create_image_bitmap
      else
        battle_luna_dpip_create_bitmap
      end
    else
      if setting_image[:enable_words]
        create_word_bitmap
      else
        battle_luna_dpip_create_bitmap
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: create_image_bitmap
  #--------------------------------------------------------------------------
  def create_image_bitmap
    case @rule
    when :hp_dmg;  num_bitmap = setting_image[:numbers_setup][:hp_number_dmg]
    when :mp_dmg;  num_bitmap = setting_image[:numbers_setup][:mp_number_dmg]
    when :tp_dmg;  num_bitmap = setting_image[:numbers_setup][:tp_number_dmg]
    when :hp_heal; num_bitmap = setting_image[:numbers_setup][:hp_number_heal]
    when :mp_heal; num_bitmap = setting_image[:numbers_setup][:mp_number_heal]
    when :tp_heal; num_bitmap = setting_image[:numbers_setup][:tp_number_heal]
    end
    num_bitmap = Cache.system(num_bitmap)
    #---
    bw = Graphics.width
    bh = num_bitmap.height * 2
    bitmap = Bitmap.new(bw, bh)
    #---
    spacing  = setting_image[:numbers_setup][:spacing]
    nwidth   = num_bitmap.width / 10
    nheight  = num_bitmap.height
    ncount   = @data[0].size
    twidth   = ncount * (nwidth + spacing) - spacing
    offset_x = [(bw - twidth) / 2, 0].max
    #---
    (0...ncount).each { |index|
      x = offset_x + index * (nwidth + spacing)
      number = @data[0][index].to_i
      rect   = Rect.new(nwidth * number, 0, nwidth, nheight)
      bitmap.blt(x, 0, num_bitmap, rect)
    }
    bitmap
  end
 
  #--------------------------------------------------------------------------
  # new method: create_word_bitmap
  #--------------------------------------------------------------------------
  def create_word_bitmap

    raw = setting[:word_setting][@rule]
    image_name = (raw && !raw.include?("%s")) ? raw : @data[0].to_s
    begin
      word_bitmap = Cache.system(image_name)
    rescue

      return battle_luna_dpip_create_bitmap
    end

    bw = Graphics.width
    bh = word_bitmap.height
    bitmap = Bitmap.new(bw, bh) 
    offset_x = [(bw - word_bitmap.width) / 2, 0].max
    bitmap.blt(offset_x, 0, word_bitmap, word_bitmap.rect)
    bitmap
  end
 
end # Sprite_PopupLuna
end
Thank you so much for your help!🙂

Original thread: https://forums.rpgmakerweb.com/threads/critical-hit-animation-script.182747/