Damage Popups appearing behind actor stats in battle

Hello,

I enjoy RPGMaker XP but this has always bothered me. Is there any way to make it so that the damage popups appear in front of the actor's stats when taking damage in battle? Or any way to customize the damage popups in general? I looked all throughout the script database, but I couldn't really find anything referencing it in there.

Thanks


1766188560074.png
Don't have that Maker installed right now to test stuff myself. I don't remember if this was always the default?

Either way, the damage pop-ups should be handled in the RPG::Sprite class, which is one of the few classes that are loaded before the scripts in the script editor and not visible there.
However, you can find the implementation code in the makers help file (F1). (I also found it online)

Without having tested it, you could try removing the viewport of the created damage sprite by replacing the method in a new script:
Spoiler
Ruby:
class RPG::Sprite
 
  def damage(value, critical)
    dispose_damage
    if value.is_a?(Numeric)
      damage_string = value.abs.to_s
    else
      damage_string = value.to_s
    end
    bitmap = Bitmap.new(160, 48)
    bitmap.font.name = "Arial Black"
    bitmap.font.size = 32
    bitmap.font.color.set(0, 0, 0)
    bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
    if value.is_a?(Numeric) and value < 0
      bitmap.font.color.set(176, 255, 144)
    else
      bitmap.font.color.set(255, 255, 255)
    end
    bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
    if critical
      bitmap.font.size = 20
      bitmap.font.color.set(0, 0, 0)
      bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
      bitmap.font.color.set(255, 255, 255)
      bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
    end
    @_damage_sprite = Sprite.new  # <- Edit: Removed the Viewport
    @_damage_sprite.bitmap = bitmap
    @_damage_sprite.ox = 80
    @_damage_sprite.oy = 20
    @_damage_sprite.x = self.x
    @_damage_sprite.y = self.y - self.oy / 2
    if self.viewport  # Edit: Adjust coordinates for viewport (not needed by default)
      @_damage_sprite.x += self.viewport.rect.x - self.viewport.ox
      @_damage_sprite.y += self.viewport.rect.y - self.viewport.oy
    end
    @_damage_sprite.z = 3000
    @_damage_duration = 40
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/damage-popups-appearing-behind-actor-stats-in-battle.181524/