(help)RAZIEL hud on the battle system

Hello, I currently found this script

credits to raziel for doing so


Code:
#==============================================================================
# ** Hud Menu
#==============================================================================
# Raziel
# Version 2.0
# 2007-08-18
#------------------------------------------------------------------------------
#===============================================================================

# * Module Raz_Hud
#===============================================================================


module Raz_Hud
 #switch to show/hide the hud
 SWITCH_ID = 112
 #set it to true to center the hud if there are less than four party members
 Center_hud = false
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
 #----------------------------------------------------------------------------
 # * Alias Listings
 #----------------------------------------------------------------------------
 alias raz_hud_main main
 alias raz_hud_update update
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   @hud_dummy = []
   for i in 0...$game_party.actors.size
     @hud_dummy[i] = Window_Dummy.new(i)
   end
   @hud_window = Window_HUD.new
   raz_hud_main
   @hud_window.dispose
   @hud_dummy.each { |hud| hud.dispose }
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   @hud_dummy.each {|hud| hud.visible = $game_switches[Raz_Hud::SWITCH_ID]}
   if @hud_dummy[$game_party.actors.size] != nil
     @hud_dummy.each{|hud| hud.dispose}
     @hud_dummy = []
     for i in 0...$game_party.actors.size
       @hud_dummy[i] = Window_Dummy.new(i)
     end
   end
   @hud_window.update
   raz_hud_update
 end
end
#===============================================================================

# * Window_HUD
#===============================================================================


class Window_HUD < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0, 800, 600)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   self.visible = $game_switches[Raz_Hud::SWITCH_ID]
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   @old_hp, @old_sp, @old_exp, @old_size = [],[],[],$game_party.actors.size
   for actor in $game_party.actors
     @old_hp << actor.hp; @old_sp << actor.sp; @old_exp << actor.exp
     a = $game_party.actors.size - 1
     center = Raz_Hud::Center_hud == true ? (240 - (a * 80)) : 0
     x = ($game_party.actors.index(actor) * 160 + 25) + center
     self.contents.font.size = 21
     draw_actor_graphic(actor, x - 15, 445)
     self.contents.font.color = normal_color
     self.contents.draw_text(x - 25, 360, 100, 32, actor.name)
     draw_slant_bar(x + 8, 396, actor.hp, actor.maxhp, 100, 6)
     draw_slant_bar(x + 8, 416, actor.sp, actor.maxsp, 100, 6, Color.new(0, 0, 150), Color.new(60, 155, 155))
     now_exp = actor.level == 99 ? 1 : actor.now_exp
     next_exp = actor.level == 99 ? 1 : actor.next_exp
     draw_slant_bar(x + 8, 436, now_exp, next_exp, 100, 6, Color.new(0, 150, 0), Color.new(60, 255, 60))
     self.contents.font.size = 16
     draw_actor_state(actor, x + 45, 360)
     self.contents.font.color = normal_color
     self.contents.font.bold = true
     self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
     self.contents.draw_text(x + 16, 382, 100, 32, "#{actor.hp}/#{actor.maxhp}", 1)
     self.contents.font.color = actor.sp == 0 ? crisis_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
     self.contents.draw_text(x + 16, 402, 100, 32, "#{actor.sp}/#{actor.maxsp}", 1)
     self.contents.font.color = system_color
     self.contents.font.size = 20
     self.contents.font.bold = false
     self.contents.draw_text(x, 384, 50, 32, $data_system.words.hp)
     self.contents.draw_text(x, 404, 50, 32, $data_system.words.sp)
     self.contents.draw_text(x, 424, 50, 32, "Exp")
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   refresh if @old_size != $game_party.actors.size
   @old_hp.each_with_index {|hp, index| refresh if hp != $game_party.actors[index].hp}
   @old_sp.each_with_index {|sp, index| refresh if sp != $game_party.actors[index].sp}
   @old_exp.each_with_index {|exp, index| refresh if exp != $game_party.actors[index].exp}
   self.visible = $game_switches[Raz_Hud::SWITCH_ID]
 end
end
#===============================================================================

# * Window_Dummy
#===============================================================================


class Window_Dummy < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #   size: Party's size
 #--------------------------------------------------------------------------
 def initialize(size)
   @old_size = $game_party.actors.size
   x = Raz_Hud::Center_hud == true ? 240 - ($game_party.actors.size - 1) * 80 : 0
   super(160 * size + x, 372,160, 108)
   self.visible = $game_switches[Raz_Hud::SWITCH_ID]
   self.opacity = 255
 end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
 #--------------------------------------------------------------------------
 # * 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))
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
   end
   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
   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
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
 #--------------------------------------------------------------------------
 # * Now Exp
 #--------------------------------------------------------------------------
 def now_exp
   return @exp - @exp_list[@level]
 end
 #--------------------------------------------------------------------------
 # * Next Exp
 #--------------------------------------------------------------------------
 def next_exp
   return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
 end
end

is a somewhat interesting script because the huds are mini-windows

eeb2f61ff8124b3cde64d7e474c1c046.


I wanted to be able to use them as the default window of the battle system,

or something like the image below (this is merely illustrative XD)

hYeBScS.png


but I am very bad with scripts and
and I can not do this
if someone can help me
I will be grateful

PS: Forgive my English.
Well, a BattleStatus window 'is' a hud, but one meant and designed for use with the battlesystem. What you need is a script to replicate the appearance of his Hud. Rather entertaining... I haven't messed with Raz in a decade. 😛

Do you need Experience to even show?

Spoiler: Images for viewing
ut1.jpg
Assumes you have only 3 members left. Centers the three and their windows.

ut2.jpg
Recognizes three battlers, leaving a slot open for the fourth. Note: Fourth slot does 'not' have rounded borders on all sides.

ut3.jpg
Here, I again have centered battlers. Note that there is black space around because I eliminated the excess blue background and the default 'Battle Background' is set for 640x320.... and not 640x480. You can have a full 640x480 in your game, but it would need (1) you to edit your Spriteset_Battle / viewport one / line #19 to match the others, and (2) have 640x480 battle backgrounds. All RTP ones are 640x320.


This is a WIP script, one that has loose ties to Cogwheel's system if only to center the battlers and give a border around each one's stats as the Raz hud depicts. Technically, I could make the one script deliver all three options in the spoiler.

Do I continue???
wow please continue this would be of great help!


no need to show the EXP

and can you show character sprites instead of battlers?
I could do one better.... a CONFIG section that lets you choose.
* o *
man this will help me a lot I'm already thanking you for that
SLIGHT realization. The battlers are built into 'Spriteset Battler', so the battlestatus script won't touch them. XD On the other hand, if you want a sideview battlesystem like Animbat, it should work fine. OTHERWISE, you could just set your actor's battlers to 'none' ??

littlework.jpg

Well, I was waiting for your reply. This was 20 minutes of adjusting to get 'close' to Raz's hud. Still some to go... His hud ignored the 16px border, so I'm going to do a work around of my own. Gonna do it a little at a time, but I do try. And yep, I'm going to take placement of the Actor Command Window's vertical height into consideration.
Here ya go:

Code:
#==============================================================================
# ** Raz-based Battlestatus                            (07/27/2019)(mm/dd/yyyy)
#------------------------------------------------------------------------------
#  Essentially, a battlestatus meant to resemble the Hud Menu by Raziel(2007).
#
#  Battlestatus window mimics dimensions, so the height is much lower than the
#  default. As such, the battlesystem's actor command window was repositioned.
#
#  Recommends edit to the Spriteset_Battle (line 19) to increase vertical depth
#  of the battlesystem background.
#
#  Actual battler graphics not affected.
#
#==============================================================================

module Raz_Bstat
 
  # 0 = Centered and no background
  # 1 = cente with background area
  # 2 = Left Adjusted
  STYLE = 0
 
  # If true, shade effect around HP/SP display
  # If false, none exists
  HPSP_SHADE = true
 
  # If true, Charset appears in window and stats indent accordingly
  # If false, no charset and HP SP are left adjusted.
  CHARSET    = false
 
end



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Slant Bar (by SephirothSpawn)
  #     x         : x-position
  #     y         : y-position
  #     min       : current value of bar (ie actor.hp)
  #     max       : maximum value of bar (ie actor.maxhp)
  #     width     : (optional) horizontal width of bar in pixels (def: 152)
  #     height    : (optional) vertical height of bar in pixels  (def: 6)
  #     har_color : (optional) left-side start color of bar      (def: dk red)
  #     end_color : (optional) right-side end color of bar       (def: yellow)
  #--------------------------------------------------------------------------
  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))
       
   for i in 0..height
     self.contents.fill_rect(x + i, y + height - i, width + 1, 1,
       Color.new(50, 50, 50, 255))
   end
   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
   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
end



#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Battle Screen X-Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    # Calculating X coordinate from line order inside the party, it returns
    if self.index != nil
      if Raz_Bstat::STYLE == 2
        return self.index * 160 + 80
      else
        return self.index * 160 + (4 - $game_party.actors.size) * 80 + 80
      end
    else
      return 0
    end
  end
end



#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  It is the window which indicates the status of the party member in the
#  battle picture.
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    x       = 0
    if Raz_Bstat::STYLE != 2
    x       = (4 - $game_party.actors.size) * 80
    end
    width   = $game_party.actors.size * 160
    case Raz_Bstat::STYLE
    when 1; # With Backtround
              super(-4, 348, 648, 132)
              self.contents = Bitmap.new(width - 32, height - 32)   
              self.back_opacity = 255
    else ;  # Centered only
            super(x, 348, width, 132)
            self.opacity = 0
    end
    # Initialize Party Windows
    init_party
  end
  #--------------------------------------------------------------------------
  # * Object Initialization : Party Windows
  #--------------------------------------------------------------------------
  def  init_party
    @old_size = $game_party.actors.size
    unless @dummy_window.nil?
      for w in @dummy_window
        w.dispose
      end
    end
    unless @actor_window.nil?
      for w in @actor_window
        w.dispose
      end
    end
    @dummy_window = []
    @actor_window = []
    if Raz_Bstat::STYLE == 2
      for i in 0...4
        @dummy_window.push(Window_ActorDummy.new(i, i * 160 ))
      end
      for i in 0...$game_party.actors.size
      @actor_window.push(Window_ActorStatus.new(i, -8 + (i * 160)))
      end
    else
      for i in 0...$game_party.actors.size
        x = i * 160 + (4 - $game_party.actors.size) * 80
        @dummy_window.push(Window_ActorDummy.new(i, x))
        @actor_window.push(Window_ActorStatus.new(i, -8 + x ))
      end
    end
    @level_up_flags = [false, false, false, false]
    refresh   
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    for window in @actor_window
      window.dispose
    end
    for window in @dummy_window
      window.dispose
    end   
    super
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(number = 0)    if number == 0
      cnt = 0
      for window in @actor_window
        window.refresh(@level_up_flags[cnt])
        cnt += 1
      end
    else
      @actor_window[number - 1].refresh(@level_up_flags[number - 1])
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Renewal
  #--------------------------------------------------------------------------
  def update
    super
    # Ensure reset of party display if party size changed
    init_party if @old_size != $game_party.actors.size
  end
end



#==============================================================================
# ** Window_ActorDummy
#------------------------------------------------------------------------------
#  A backround window for battler data, merely creating a backdrop.
#==============================================================================

class Window_ActorDummy < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(id, x)
    super(x, 348, 160, 132)
    self.contents   = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    super
  end  
end



#==============================================================================
# ** Window_ActorStatus
#------------------------------------------------------------------------------
#  It is the window which indicates the status of the party member respectively
#  in the battle picture.
#==============================================================================

class Window_ActorStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(id, x)
    super(x, 348, 176, 132)
    @actor_num      = id
    self.opacity    = 0
    self.contents   = Bitmap.new(width - 32, height - 32)
    refresh(false)
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(level_up_flags)
    self.contents.clear
    actor = $game_party.actors[@actor_num]
    return if actor.nil?
    x = 0
    if Raz_Bstat::CHARSET == true
      draw_actor_graphic(actor, 16, 32+48)
      x = 32
    end
    self.contents.font.size = 21
    self.contents.font.bold = false             
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 100, 32, actor.name)   
    draw_slant_bar(x, 38, actor.hp, actor.maxhp, 132-x, 6)
    draw_slant_bar(x, 62, actor.sp, actor.maxsp, 132-x, 6)
    self.contents.font.size = 16
    self.contents.font.bold = false             
    draw_actor_state(actor, 69,0)
    self.contents.font.color = system_color
    self.contents.font.size = 20
    self.contents.font.bold = false   
    self.contents.draw_text(x, 24, 50, 32, $data_system.words.hp)
    self.contents.draw_text(x, 48, 50, 32, $data_system.words.sp)
    self.contents.font.size = 16
    self.contents.font.color = normal_color
    self.contents.font.bold = true
    if Raz_Bstat::HPSP_SHADE == true
      self.contents.font.color = Color.new(0,0,0,240)
      self.contents.draw_text(33+(x/2), 25, 100, 32,
        "#{actor.hp}/#{actor.maxhp}", 1)
    end
    self.contents.font.color =
      actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(32+(x/2), 24, 100, 32,
      "#{actor.hp}/#{actor.maxhp}", 1)
    if Raz_Bstat::HPSP_SHADE == true
      self.contents.font.color = Color.new(0,0,0,240)
      self.contents.draw_text(33+(x/2), 49, 100, 32,
        "#{actor.sp}/#{actor.maxsp}", 1)
    end
    self.contents.font.color =
      actor.sp == 0 ? crisis_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(32+(x/2), 48, 100, 32,
      "#{actor.sp}/#{actor.maxsp}", 1)
    if level_up_flags
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 72, 120, 32, "LEVEL UP!")
    end   
  end
  #--------------------------------------------------------------------------
  # * Frame renewal
  #--------------------------------------------------------------------------
  def update
    #At the time of main phase opacity is lowered a little
    if $game_temp.battle_main_phase
      self.contents_opacity -= 4 if self.contents_opacity > 191
    else
      self.contents_opacity += 4 if self.contents_opacity < 255
    end
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias razbstat_phase3_setup_command_window phase3_setup_command_window
 
  #--------------------------------------------------------------------------
  # * Actor Command Window Setup
  #--------------------------------------------------------------------------
  def phase3_setup_command_window
    # Original call
    razbstat_phase3_setup_command_window
    # Changing position
    @actor_command_window.y = 188
    return if Raz_Bstat::STYLE == 2
    # Setting the position of the actor command window
    @actor_command_window.x = @actor_index * 160 +
                              (4 - $game_party.actors.size) * 80
  end
end

Notes: It has a configuration section with Raziel's name in mind. There, you have three options. First option changes the layout from centered with no background, centered with background and left-adjusted like Raz's original hud. Second option adds or removes a mild shading around the HP/SP values to set them apart from the bars. Third option adds/removes the characterset graphic.

STILL, this was modeled visually on Raz's hud, and it has a lower profile (ie it's SHORT!). So you will need to alter the SPRITESET_BATTLE class on line 19 to match. Personally, I like FULL SCREEN BATTLES!!! 640x480 ALL THE WAY! 😀

And this doesn't eliminate battlers, that's controlled from SPRITESET_BATTLE too, and touched upon elsewhere. You'd just assume remove the battlers from your actor database instead.
works exactly the way I wanted it! I use animated battlers so I didn't have many problems with them, and the battleback is ok too
I'm amazed that it was too good * 0 *

the only problem is that when the battle is over and back on the map,
the windows go out only after a moment
Or to be more specific... the dummy windows that present the border effect. My bad.

FIXED now. 😉
PERFECT THANK YOU VERY MUCH!

Original thread: https://forums.rpgmakerweb.com/threads/help-raziel-hud-on-the-battle-system.111301/