Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Damage appears behind bars in battle
#1
Hello all,

I'm back to work on my project and have run into a small problem. Would anyone be willing to share his/her knowledge with me? I'm using the SephirothSpawn bar script on the menu and battle screens, and when damage to the party is displayed during battle, the number appears behind the bars (i.e., is hidden by the bar graphics). Is it possible to display the damage in front of the bars instead?

Thanks in advance for any help you're willing to offer!







Reply }
#2
Could you post the script please? This should be an easy fix.
Valdred
Tech Administrator of Save-Point

Reply }
#3
Thanks for the quick reply and offer to help!

Here is the script:

Code:
class Window_Base < Window    
  alias raz_bars_base_exp draw_actor_exp
  alias raz_bars_base_parameter draw_actor_parameter
  
  #--------------------------------------------------------------------------
  # * Draw Slant Bar(by SephirothSpawn)
  #--------------------------------------------------------------------------
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    # Calculate if there is draw space for MaxHP
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    
    if $game_temp.in_battle
      bar_width = hp_x - x + 50
      else
      bar_width = hp_x - x + 100
    end

    # Draw HP
    draw_slant_bar(x, y + 18, actor.hp, actor.maxhp, bar_width, 6, Color.new(100, 0, 0, 255), Color.new(255, 0, 0, 255))
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
    # Draw MaxHP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Calculate if there is draw space for MaxHP
    
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    
    if $game_temp.in_battle
      bar_width = sp_x - x + 50
      else
      bar_width = sp_x - x + 100
    end

    # Draw SP
    draw_slant_bar(x, y + 18, actor.sp, actor.maxsp, bar_width, 6, Color.new(0, 0, 100, 255), Color.new(0, 0, 255, 255))
    # Draw "SP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    # Draw MaxSP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    end
  end

  def draw_actor_exp(actor, x, y)
    if actor.level == 99
    draw_slant_bar(x, y + 18, 1, 1, 190, 6, Color.new(0, 100, 0, 255), Color.new(0, 255, 0, 255))
      else
    draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6, Color.new(0, 100, 0, 255), Color.new(0, 255, 0, 255))
    end
    raz_bars_base_exp(actor, x, y)
    end

    def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      para_color1 = Color.new(100,0,0)
      para_color2 = Color.new(255,0,0)
      para_begin = actor.atk
    when 1
      para_color1 = Color.new(100,100,0)
      para_color2 = Color.new(255,255,0)
      para_begin = actor.pdef
    when 2
      para_color1 = Color.new(100,0,100)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.mdef
    when 3
      para_color1 = Color.new(50,0,100)
      para_color2 = Color.new(50,0,255)
      para_begin = actor.str
    when 4
      para_color1 = Color.new(0,100,0)
      para_color2 = Color.new(0,255,0)
      para_begin = actor.dex
    when 5
      para_color1 = Color.new(50,0,50)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.agi
    when 6
      para_color1 = Color.new(0,100,100)
      para_color2 = Color.new(0,255,255)
      para_begin = actor.int
    end
    draw_slant_bar(x, y + 18, para_begin, 999, 155, 4,  para_color1, para_color2)
    raz_bars_base_parameter(actor, x, y, type)
  end
end

class Game_Actor
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end


EDIT: I FIXED THE PROBLEM BY RESTORING WINDOW_BASE TO DEFAULT. SOMETHING THERE WAS PREVENTING THIS CODE FROM WORKING PROPERLY. PLEASE MARK AS SOLVED AND CLOSE.
Reply }
#4
My apologies for posting once more here, but it turns out that the problem was not solved as I thought.

The trouble is that battle animations, damage, and "critical" / "miss" text appear behind the bars during battle. I'm still using the script posted above. If I can provide any additional information in order to make troubleshooting easier, please let me know. Thanks to anyone who is willing to help!
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   ACBS - Atoa Custom Battle System and TP System zlsl 2 3,571 10-20-2021, 05:09 AM
Last Post: zlsl
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 9,952 05-07-2021, 02:05 PM
Last Post: FrQise
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 12,392 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 11,505 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 10,576 08-08-2019, 02:50 PM
Last Post: aeliath
   YAMI Battle symphony + Holder add on (Loop casting anim) Starmage 0 3,831 03-01-2018, 09:03 AM
Last Post: Starmage
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,395 02-14-2018, 04:25 PM
Last Post: Starmage
   Atoa Individual Battle Commands Geminil 3 5,995 08-02-2017, 03:17 AM
Last Post: DerVVulfman
   Problems with counteraatack addon of Atoa Custom Battle System Djigit 22 30,834 01-05-2017, 08:05 PM
Last Post: Noctis
   RMXP SKill animations too bright (overlaying the battle screen) Starmage 4 9,026 06-13-2016, 03:41 AM
Last Post: Starmage



Users browsing this thread: