just trying to edit a hud for blizz

Started by Shalaren, August 09, 2013, 11:20:47 pm

Previous topic - Next topic

KK20

August 11, 2013, 06:37:59 pm #20 Last Edit: August 11, 2013, 06:45:18 pm by KK20
Clarifying further

def draw_text
   self.bitmap.clear
   @ach = $game_variables[5]
   self.bitmap.font.color = normal_color
   icon = RPG::Cache.icon('AC') # Gets the icon graphic. If icon file is gold.png, then you would just put 'gold'
   self.bitmap.blt(125, 0, icon, Rect.new(0, 0, 24, 24)) # Draws the icon to the bitmap. Just need to put in your x and y values.
   #self.bitmap.draw_text_full(125,0, 20, 20, 'AC')
   self.bitmap.font.color = Color.new(193,172,81)
   self.bitmap.draw_text_full(2,0, 120, 20,@ach.to_s,2)

 end

I think the reason you couldn't see it was because you didn't set up your x- and y-values and you did Rect.new(125, 0, 24, 24) when the 125 should be a 0. Rect is kinda like your crop tool

Rect.new(x, y, width, height)

Icons are only 24 x 24 pixel graphics. You want it to crop the entire image, so you start the crop at the top left corner and get the area within 24 pixels to the right and down.

To understand it better, mess around with the variables a bit.

Rect.new(0, 0, 12, 24) # Gets the left half of the icon
Rect.new(12, 0, 12, 24) # Gets the right half of the icon
Rect.new(0, 0, 24, 12) # Gets the top half of the icon
Rect.new(0, 12, 24, 12) # Gets the bottom half of the icon
Rect.new(24, 0, 24, 24) # Won't draw anything because you are effectively outside of the 24x24 image


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

ohhhhh ok I get it..
Thanks :)

heres another question, when in game I noticed when I change map, the hotkey part with the character name and all stays but the minimap fades out and restores itself when the next map is loaded, it just looks weird when it fades out like that. what is the difference between the minimap and the rest that this happens? im not asking you guys to fix it I just want to know how I can fix that myself :P

I tried the take the mini map dispose out, it worked and the abckground of the minimap carried on to other maps when it changes, but then it carries on to other scenes as well. 

KK20

Can't really say for sure since I can't exactly picture the problem in my head. It definitely has to do with disposing the sprites. Post your updated HUD script and I can probably see what the problem is.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

Spoiler: ShowHide
module Hud_Config
  HP       = 'HP'
  MP       = 'MP'
  EXP      = 'EXP'
  Empty    = 'Empty'
  EmptyExp = 'Empty_Exp'
  Back     = 'Back'
  MapBack  = 'Map_Back'
  EmptyExt = 'Empty_'
end
#==============================================================================
# Hud
#------------------------------------------------------------------------------
#  This class was modified to support SR display and modify the number of
#  skills left to use.
#==============================================================================
$map_infos = load_data('Data/MapInfos.rxdata')
$map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}

class Hud < Sprite
 
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(viewport = nil)
    # call superclass method
    super
    # create positions
    create_positions
    # get height
    h = @hud_height
    $game_system.minimap = 1
    $game_system.hotkeys = true
    @name = Player_Name.new(self)
    @lvl  = Player_Lvl.new(self)
    @gold = Party_Gold.new(self)
    @ach = Party_ach.new(self)
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 12
    # set font to bold
    self.bitmap.font.bold = true
    # set x, y position depending on which HUD mode
    self.y = 480 - (h)
    # set z coordinate
    self.z = 1000
    # draw basic HUD
    draw_basic
    # update
    update
  end
  #----------------------------------------------------------------------------
  # create_positions
  #  Sets drawing positions. Can be aliased and the positions modified to
  #  create a different HUD.
  #----------------------------------------------------------------------------
  def create_positions
    @original_width = @hud_width = 474
    @original_height = @hud_height = 54
    @hp_x, @hp_y, @sp_x, @sp_y = 3, 15, 3, 35
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
    @exp_x,@exp_y,@gold_x,@gold_y, @ach_x, @ach_y = 175, 0, 0, 0, 0, 0
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    bitmap = RPG::Cache.picture('HUD/'+Hud_Config::Back)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.bitmap.blt(0,0, bitmap, src_rect)
    # determine color depending on HUD style
    color = case BlizzABS::Config::HUD_TYPE
    when 0 then Color.new(255, 255, 255, 195)
    when 1 then Color.new(0, 0, 0, 0)
    end
    # if color exists
    if color.is_a?(Color)
      # draw outline in color
      self.bitmap.fill_rect(@hp_x, @hp_y+3, 116, 14, color)
      # draw outline in color
      self.bitmap.fill_rect(@sp_x, @sp_y+3, 116, 14, color)
    end
    # set font color
    self.bitmap.font.color = system_color
  end
  #----------------------------------------------------------------------------
  # draw_empty
  #  Draws the HP and SP display when actor doesn't exist.
  #----------------------------------------------------------------------------
  def draw_empty
    # draw empty bars
    self.bitmap.gradient_bar_hud(@hp_x, @hp_y+3, 114, 0, 'hud_red_bar', 1)
    # draw empty bars
    self.bitmap.gradient_bar_hud(@sp_x, @sp_y+3, 114, 0, 'hud_blue_bar', 2)
    # draw empty bars
    self.bitmap.gradient_bar_hud(@exp_x, @exp_y+3, 200,0, 'hud_green_bar', 3)
    # set font color
    self.bitmap.font.color = disabled_color
    # draw empty HP
    self.bitmap.draw_text_full(@hp_x + 6, @hp_y, 48, 20, '0', 2)
    self.bitmap.draw_text_full(@hp_x + 54, @hp_y, 12, 20, '/', 1)
    self.bitmap.draw_text_full(@hp_x + 66, @hp_y, 48, 20, '0')
    # draw empty SP
    self.bitmap.draw_text_full(@sp_x + 6, @sp_y, 48, 20, '0', 2)
    self.bitmap.draw_text_full(@sp_x + 54, @sp_y, 12, 20, '/', 1)
    self.bitmap.draw_text_full(@sp_x + 66, @sp_y, 48, 20, '0')
     # draw empty EXP
    self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, '0.0', 2)
    # reset all flag variables
    @name = @level = @hp = @sp = @maxhp = @maxsp = @exp = @states = @skill =
        @skills_left = @item = @items_left = @gold = @ach = @exp = nil
  end
  #----------------------------------------------------------------------------
  # draw_hp
  #  Draws the HP display.
  #----------------------------------------------------------------------------
  def draw_hp
    # set current variables
    @hp, @maxhp = actor.hp, actor.maxhp
    # set fill rate
    rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
    # draw gradient bar
    self.bitmap.picture_bar(@hp_x, @hp_y+3,rate,Hud_Config::HP)
    # set font color depending on how many HP left
    self.bitmap.font.color = @hp == 0 ? knockout_color :
        @hp <= @maxhp / 4 ? crisis_color : normal_color
    # draw HP
    self.bitmap.draw_text_full(@hp_x+6, @hp_y, 48, 20, @hp.to_s, 2)
    # set color
    self.bitmap.font.color = normal_color
    # draw "/"
    self.bitmap.draw_text_full(@hp_x+54, @hp_y, 12, 20, '/', 1)
    # draw max HP
    self.bitmap.draw_text_full(@hp_x+66, @hp_y, 48, 20, @maxhp.to_s)
    self.bitmap.draw_text_full(@hp_x+2, @hp_y, 32, 20, $data_system.words.hp)
  end
  #----------------------------------------------------------------------------
  # draw_sp
  #  Draws the SP display.
  #----------------------------------------------------------------------------
  def draw_sp
    # set current variables
    @sp, @maxsp = actor.sp, actor.maxsp
    # set fill rate
    rate = (@maxsp > 0 ? @sp.to_f / @maxsp : 0)
    # draw gradient bar
    self.bitmap.picture_bar(@sp_x, @sp_y+3,rate,Hud_Config::MP)
    # set font color depending on how many SP left
    self.bitmap.font.color = @sp == 0 ? knockout_color :
        @sp <= @maxsp / 4 ? crisis_color : normal_color
    # draw SP
    self.bitmap.draw_text_full(@sp_x+6, @sp_y, 48, 20, @sp.to_s, 2)
    # set font color
    self.bitmap.font.color = normal_color
    # draw "/"
    self.bitmap.draw_text_full(@sp_x+54, @sp_y, 12, 20, '/', 1)
    # draw max SP
    self.bitmap.draw_text_full(@sp_x+66, @sp_y, 48, 20, @maxsp.to_s)
    self.bitmap.draw_text_full(@sp_x+2, @sp_y, 32, 20, $data_system.words.sp)
  end
  #----------------------------------------------------------------------------
  # draw_exp
  #  Draws the EXP display.
  #----------------------------------------------------------------------------
  def draw_exp
    # set current variables
    @exp = actor.exp
    # set fill rate
    rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
    # draw gradient bar
    self.bitmap.picture_bar(@exp_x, @exp_y+3,rate,Hud_Config::EXP)
    self.bitmap.font.color = normal_color
    percent = (rate * 100).to_i
    self.bitmap.draw_text_full(@exp_x+60, @exp_y, 200, 18,
    "#{actor.cur_exp} / #{actor.max_exp}")
    self.bitmap.draw_text_full(@exp_x+195, @exp_y, 145, 18,percent.to_s)
    self.bitmap.draw_text_full(@exp_x+210, @exp_y, 150, 18,'%')
    self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 18, 'EXP')
  end
 
  def draw_name
  end
 
  def draw_level
  end
   
  alias hud_update update
  def update
    draw_basic  if $game_temp.hud_refresh
    $game_temp.hud_refresh ? draw_exp : test_exp if actor != nil
    @gold.update
    @ach.update
    @name.update
    @lvl.update
    hud_update
  end
 
  def dispose
    super
    @name.dispose
    @lvl.dispose
    @gold.dispose
    @ach.dispose
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end
 
  def test_name
    return
  end
 
  def test_level
    return
  end
 
end

class Hotkey_Assignment < Sprite
 
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # set x and y position
    self.x, self.y, self.z = 174, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
 
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(30*(i-1), 0, 24, 24, Color.new(0, 0, 0, 0))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # draw bitmap
            self.bitmap.blt(30*(i-1), 0, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          self.bitmap.draw_text_full(30*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
 
  alias hud_update update
  def update
    $game_system.hotkeys = ($game_system.hud)
    hud_update
  end
 
end

class Minimap < Sprite
 
  def initialize
    # call superclass method
    super(Viewport.new(478, 359, 160, 120))
    # get autotile image from Blizz-ABS Cache
    @autotile = $BlizzABS.cache.image('minimap_autotile')
    # creates the passable floor map
    @map_back = Map_Back.new(self)
    create_passable_floor
    # set x and y position
    self.x = self.y = 0
    # set z position
    viewport.z = 5000
    # store events
    @events, @names = check_events
    # create sprites for events
    create_sevents
    @map_name = Map_Name.new(self)
    # set all sprites visible
    self.visible = true
    # update
    update
  end
 
  alias hud_update update
  def update(con=false)
    hud_update(con)
    @map_back.update
    @map_name.update
  end
 
  def dispose
    destroy_sevents
    @map_back.dispose
    @map_name.dispose
    super
  end
 
end

class Scene_Hotkeys
 
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 0, 0)
    # set tone to current screen tone
    @view.tone = @tone.clone
    # create HUD if HUD is turned on and HUD active
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    # if ASSIGNMENT is turned
    if BlizzABS::Config::HOTKEYS
      # create assignment display
      @hotkeys = Hotkey_Assignment.new
      # set z position
      @hotkeys.z = 5000
    end
    # if MINIMAP is turned on and minimap active
    if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      # create minimap
      @minimap = Minimap.new
    end
    # create sprite
    @choice = Sprite.new
    # create bitmap
    @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
    @choice.angle = 180
    # set x, y and z positions
    @choice.x, @choice.y, @choice.z, @choice.opacity = 204, 448, 5001, 108
    # set x position offset
    @choice.ox = -8
    # set active flag
    @active = true
    # set index
    @index = 0
    # set up mode flag
    @up_mode = true
    # create modified skill window
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    @skill_window.y -= 66
    @skill_window.height -= 70
    # create modified item window
    @item_window = Window_Item_Hotkey.new
    @item_window.y -= 66
    @item_window.height -= 70
    # set last active
    @last_active = true
    # transtition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # frame update
      update
      # stop if chosen an option
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delete spriteset
    @spriteset.dispose
    # delete HUD elements that exist
    [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    # delete choice sprite
    @choice.dispose
    # delete skill window
    @skill_window.dispose
    # delete item window
    @item_window.dispose
    # delete viewport
    @view.dispose
    # while real leader is not first actor in party
    while @party_leader != $game_party.actors[0]
      # switch to next actor
      $BlizzABS.player.switch_leader
    end
  end
 
  def update_choice
    # set x position
    @choice.x = 204 + @index * 30
    # if pressed B
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Map.new
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # not active
      @active = false
      # the one that was active the last time is now active
      @skill_window.active = @last_active
      @item_window.active = (!@last_active)
    # if RIGHT is being pressed
    elsif Input.repeat?(Input::RIGHT)
      # if RIGHT is pressed or index is less than 9
      if Input.trigger?(Input::RIGHT) || @index < 9
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 1) % 10
      end
    # if LEFT is being pressed
    elsif Input.repeat?(Input::LEFT)
      # if LEFT is pressed or index is equal or greater than 1
      if Input.trigger?(Input::LEFT) || @index >= 1
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 9) % 10
      end
    end
  end
 
end

class Map_Back < Sprite
 
  def initialize(map)
    super()
    self.x ,self.y, self.z = 474, 356, 4999
    self.bitmap = RPG::Cache.picture('HUD/'+Hud_Config::MapBack)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.bitmap.blt(0, 0, bitmap, src_rect)
    @map = map
  end
 
  def update
    self.opacity = @map.opacity
    if $game_system.minimap != 1
      self.visible = false
    end
  end
 
end

class Map_Name < Sprite
 
  def initialize(map)
    super()
    self.x ,self.y, self.z = 474, 456, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 16
    draw_map_name
    @map = map
  end
 
  def draw_map_name
    self.bitmap.clear
    @map_id = $game_map.map_id
    self.bitmap.draw_text_full(0,0, 160, 20, $map_infos[@map_id],1)
  end
 
  def update
    super
    self.opacity = @map.opacity
    if $game_system.minimap != 1
      self.visible = false
    end
    draw_map_name if @map_id != $game_map.map_id
  end
 
end

class Player_Name < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 123, 441, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 14
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @actor = @hud.actor
    self.bitmap.font.color = Color.new(255, 255, 255)
    self.bitmap.draw_text_full(0,0, 120, 20, @actor.name)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @actor != @hud.actor
  end
 
end

class Player_Lvl < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 123, 461, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 12
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @level = @hud.actor.level
    self.bitmap.font.color = system_color
    self.bitmap.draw_text_full(0,0, 20, 20, 'LV')
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(15,0, 20, 20, @level.to_s,2)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @level != @hud.actor.level
  end
 
end

class Party_Gold < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 336, 409, 5001
    self.bitmap = Bitmap.new(140,34)
    self.bitmap.font.size = 16
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @gold = $game_party.gold
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(125,0, 20, 20, $data_system.words.gold)
    self.bitmap.font.color = Color.new(193,172,81)
    self.bitmap.draw_text_full(2,0, 120, 20,@gold.to_s,2)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @gold != $game_party.gold
  end
 
end

class Party_ach < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 280, 409, 5001
    self.bitmap = Bitmap.new(180,34)
    self.bitmap.font.size = 16
    @hud = hud
    draw_text
  end
 
def draw_text
    self.bitmap.clear
    @ach = $game_variables[5]
    self.bitmap.font.color = normal_color
    icon = RPG::Cache.icon('AC') # Gets the icon graphic. If icon file is gold.png, then you would just put 'gold'
    self.bitmap.blt(117, -4, icon, Rect.new(0, 0, 24, 24)) # Draws the icon to the bitmap. Just need to put in your x and y values.
    #self.bitmap.draw_text_full(125,0, 20, 20, 'AC')
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(2,0, 120, 20,@ach.to_s,2)

  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @ach != $game_variables[5]
  end
 
end

class Game_Actor < Game_Battler
 
  def cur_exp
    return (@exp - @exp_list[@level] > 0 ? @exp - @exp_list[@level] : 0)
  end
 
  def max_exp
    return (@exp_list[@level] - @exp_list[@level+1]).abs
  end
 
end

class Bitmap
 
  def picture_bar(x,y,r,image)
    empty_bar = RPG::Cache.picture('HUD/'+Hud_Config::EmptyExt+image)
    bar       = RPG::Cache.picture('HUD/'+image)
    h = bar.height
    w = bar.width
    self.blt(x,y,empty_bar,Rect.new(0,0,w,h))
    self.blt(x,y,bar,Rect.new(0,0,w*r,h))
  end

end

KK20

I don't see anything fading at all. :huh:
Demo?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

it loads forever x-x so I just tried playing around with it,
it doesnt fade for you because "Tons of addons" causes it, it happens when I have it, but when I deleted it, it doesnt happen.
my guess is its because of the "Black Fade" feature in tons of addons

anyway i can fix it without taking tons of addons out?

KK20

If you know what feature in TONS is causing it. I just tried Black Fade...wasn't it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

ah crap. this is gonna take a while x-x
I just need some features in that script and its definitely none of the ones I need that's causing it...
well Ill try to play around with it and ill let ya know if I find out which one causes it S:

regardless thank you for your help! youve helped me alot :) *lv up

Shalaren

um hey, I was testing the game and realized something in the hud,  im using direct hotkeys,
so besically if I put potions on the hotkeys, I cant really know how many are there
Spoiler: ShowHide

its like this, its just unknown how many potions are there,
so I wanted to know if there is a way to put numbers on them
something like
Spoiler: ShowHide

Do I just need to change something in the class Hotkey_Assignment ? what would I need to add in there to make it so it shows the amount?

KK20

Replace class Hotkey_Assignment in your HUD script:

class Hotkey_Assignment < Sprite
 
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # Item quantities (set-up properties) ====================
    @item_qty_sprite = Sprite.new(viewport)
    @item_qty_sprite.bitmap = Bitmap.new(320, 32)
    @item_qty_sprite.x = 174
    @item_qty_sprite.y = 448
    #@item_qty_sprite.font.name = ""
    #@item_qty_sprite.font.color = Color.new(255,255,255,255)
    #@item_qty_sprite.font.size = 20
    @old_qty = {}
    # End =====================================================
    # set x and y position
    self.x, self.y, self.z = 174, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys

    # update display
    update
  end
 
  alias set_qty_z z=
  def z=(amt)
    @item_qty_sprite.z = amt + 100
    set_qty_z(amt)
  end
 
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
          qty = $game_party.item_number(object.id)
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(30*(i-1), 0, 24, 24, Color.new(0, 0, 0, 0))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # Draw item quantity
            if qty != nil
              @old_qty[object.id] = -1
              update_item_qty(i)
            else
              @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
            end
            # draw bitmap
            self.bitmap.blt(30*(i-1), 0, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          self.bitmap.draw_text_full(30*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
 
  def update_item_qty(index = nil)
    items_done = []
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
      if $game_player.item_hotkeys[i%10] != 0
        object_id = $game_player.item_hotkeys[i%10]
        qty = $game_party.item_number(object_id)
        if items_done.include?(object_id) || qty != @old_qty[object_id]
          # Set new quantity
          @old_qty[object_id] = qty
          # Clear old quantity number
          @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
          @item_qty_sprite.bitmap.draw_text_full(30*(i-1)+2, 10, 30, 32, qty.to_s)
          # If this item has any duplicates in hotkeys, make changes to them too
          items_done.push(object_id)
        end
      end
    }
  end
 
  alias dispose_all_sprites dispose
  def dispose
    @item_qty_sprite.dispose
    dispose_all_sprites
  end
 
  alias hud_update update
  def update
    $game_system.hotkeys = $game_system.hud
    @item_qty_sprite.visible = $game_system.hud
    update_item_qty if @item_qty_sprite.visible
    hud_update
  end
 
end

There are a couple things you can change like coordinates and font style.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren


if I change the size, it will only change the size for the Hotkey#, however wont change the size of the oversized Quantity. and for the quantity text, I tried to look for it in the script... can I change opacity? if not can there be an option added to change opacity?
plus could there be an option to hide the Hotkey#? I think it would look better if I just make the numbers on the background image.

and again, thank you KK20, you are a great scripter!
(I added you to my game's credit scene)

KK20

The font configuration for the quantity was right there in the initialize method (between the ========). But I noticed I wrote it wrong. Added opacity change (changing the opacity of the hotkeys also changes the opacity of the quantities. If you look at method opacity= you will see a comment I added next to the line where you can change the opacity value specifically for quantity numbers). Also removed the "draw the hotkey number" (which, if you looked under method draw, it even says "draw hotkey number" directly above the line of code that does it :P).:

class Hotkey_Assignment < Sprite
 
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # Item quantities (set-up properties) ====================
    @item_qty_sprite = Sprite.new(viewport)
    @item_qty_sprite.bitmap = Bitmap.new(320, 32)
    @item_qty_sprite.x = 174
    @item_qty_sprite.y = 448
    #@item_qty_sprite.bitmap.font.name = ""
    #@item_qty_sprite.bitmap.font.color = Color.new(255,255,255,255)
    #@item_qty_sprite.bitmap.font.size = 16
    @old_qty = {}
    # End =====================================================
    # set x and y position
    self.x, self.y, self.z = 174, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
 
  alias set_qty_z z=
  def z=(amt)
    @item_qty_sprite.z = amt + 100
    set_qty_z(amt)
  end
 
  alias set_qty_opacity opacity=
  def opacity=(amt)
    if amt == 255
      @item_qty_sprite.opacity = 255 # Change to whatever you want it to be
    else
      @item_qty_sprite.opacity = amt
    end
    set_qty_opacity(amt)
  end
 
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
          qty = $game_party.item_number(object.id)
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(30*(i-1), 0, 24, 24, Color.new(0, 0, 0, 0))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # Draw item quantity
            if qty != nil
              @old_qty[object.id] = -1
              update_item_qty(i)
            else
              @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
            end
            # draw bitmap
            self.bitmap.blt(30*(i-1), 0, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          # self.bitmap.draw_text_full(30*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
 
  def update_item_qty(index = nil)
    items_done = []
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
      if $game_player.item_hotkeys[i%10] != 0
        object_id = $game_player.item_hotkeys[i%10]
        qty = $game_party.item_number(object_id)
        if items_done.include?(object_id) || qty != @old_qty[object_id]
          # Set new quantity
          @old_qty[object_id] = qty
          # Clear old quantity number
          @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
          @item_qty_sprite.bitmap.draw_text_full(30*(i-1)+2, 10, 30, 32, qty.to_s)
          # If this item has any duplicates in hotkeys, make changes to them too
          items_done.push(object_id)
        end
      end
    }
  end
 
  alias dispose_all_sprites dispose
  def dispose
    @item_qty_sprite.dispose
    dispose_all_sprites
  end
 
  alias hud_update update
  def update
    $game_system.hotkeys = $game_system.hud
    @item_qty_sprite.visible = $game_system.hud
    update_item_qty if @item_qty_sprite.visible
    hud_update
  end
 
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

August 15, 2013, 01:19:10 am #32 Last Edit: August 15, 2013, 01:28:49 am by Shalaren
So wait how do I change the size for the Quantity? its still enormous S:
I changed the opacity in the option you added but it makes no difference. the only configuration I am able to do to the Quantity it seems is to change the X and Y values
I want to take the bold off and make it really small, opacity lower and put it at the corner of the hotkey. but no matter what I do it stays as big as it is in the picture above  :wacko:

Edit: Yeah I see what you did, The text was green so I missed it! found the Size feature and all...
Regardless-- the Opacity doesnt work, the rest does tho :)

KK20

Alright hopefully this is it xP

QTY_OPACITY = 255

class Hotkey_Assignment < Sprite
 
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # Item quantities (set-up properties) ====================
    @item_qty_sprite = Sprite.new(viewport)
    @item_qty_sprite.bitmap = Bitmap.new(320, 32)
    @item_qty_sprite.x = 174
    @item_qty_sprite.y = 448
    @item_qty_sprite.opacity = QTY_OPACITY
    @opacity_dec_amt = ((QTY_OPACITY - (QTY_OPACITY * 0.315))/7).to_i
    #@item_qty_sprite.bitmap.font.name = ""
    #@item_qty_sprite.bitmap.font.color = Color.new(255,255,255,255)
    #@item_qty_sprite.bitmap.font.size = 16
    @old_qty = {}
    # End =====================================================
    # set x and y position
    self.x, self.y, self.z = 174, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
 
  alias set_qty_z z=
  def z=(amt)
    @item_qty_sprite.z = amt + 100
    set_qty_z(amt)
  end
 
  alias set_qty_opacity opacity=
  def opacity=(amt) #goes from 255 to 80
    @item_qty_sprite.opacity = QTY_OPACITY + (@opacity_dec_amt*((self.opacity-80)/25-7))
    set_qty_opacity(amt)
  end
 
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
          qty = $game_party.item_number(object.id)
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(30*(i-1), 0, 24, 24, Color.new(0, 0, 0, 0))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # Draw item quantity
            if qty != nil
              @old_qty[object.id] = -1
              update_item_qty(i)
            else
              @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
            end
            # draw bitmap
            self.bitmap.blt(30*(i-1), 0, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          self.bitmap.draw_text_full(30*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
 
  def update_item_qty(index = nil)
    items_done = []
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
      if $game_player.item_hotkeys[i%10] != 0
        object_id = $game_player.item_hotkeys[i%10]
        qty = $game_party.item_number(object_id)
        if items_done.include?(object_id) || qty != @old_qty[object_id]
          # Set new quantity
          @old_qty[object_id] = qty
          # Clear old quantity number
          @item_qty_sprite.bitmap.fill_rect(30*(i-1)+2, 10, 30, 32, Color.new(0,0,0,0))
          @item_qty_sprite.bitmap.draw_text_full(30*(i-1)+2, 10, 30, 32, qty.to_s, 2)
          # If this item has any duplicates in hotkeys, make changes to them too
          items_done.push(object_id)
        end
      end
    }
  end
 
  alias dispose_all_sprites dispose
  def dispose
    @item_qty_sprite.dispose
    dispose_all_sprites
  end
 
  alias hud_update update
  def update
    $game_system.hotkeys = $game_system.hud
    @item_qty_sprite.visible = $game_system.hud
    update_item_qty if @item_qty_sprite.visible
    hud_update
  end
 
end

Opacity level is the first thing you see. That's all you need to configure. If you want to change the drawing location of the quantities exactly, locate this line in update_item_qty:

@item_qty_sprite.bitmap.draw_text_full(30*(i-1)+2, 10, 30, 32, qty.to_s, 2)

Which is in the format (x, y, width, height, text, alignment). The 2 in alignment aligns the text to the right (what you wanted, right?). There shouldn't be any need to modify the width, height, or text values.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

That's great!  :haha: lv up*

the hud is great now thank you!, now I'm just trying to work with some add ons.
I am using Action Recharge Times by Winkio
http://forum.chaos-project.com/index.php/topic,2312.0.html

tho I guess because this is a custom hud it messes it up a bit so this happens
Spoiler: ShowHide

The distance is too big, I tried playing with random numbers in the script but nothing I can see affects the distance between each recharge sprite.
I think it should be somewhere at this part
Spoiler: ShowHide
 #----------------------------------------------------------------------------
  # draw
  #  Draws the recharge sectors over the hotkey display.
  #----------------------------------------------------------------------------
  def draw(index = nil)
    # iterate through all skills that need to be recharged
    (@skillrecharge).each {|i|
      # temporary var
      object = $data_skills[$game_player.skill_hotkeys[i%10]]
      ind = $game_player.skill_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @skillrecharge.delete(i)
      end}
    # iterate through all items that need to be recharged
    (@itemrecharge).each {|i|
      # temporary var
      object = $data_items[$game_player.item_hotkeys[i%10]]
      ind = $game_player.item_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @itemrecharge.delete(i)
      end}
  end
haha I can't seem to find what I need to modify, (learning how to script is gonna take some time for me xD)

btw unrelated to the hud, only if you know what to do, --
but there is a problem with the recharge script as if you try to put recharge on items it wont do anything in game. it does work with skills however, about this problem tho Ill probably have to post in the Script Troubleshooting forum if you aren't sure.

Thanks in advance :] you've already helped so much, I'm really enjoying how this hud turned out.

KK20

Yeah, it is. You just have to play with the x- and y-coordinates a bit in the fill_rect and draw_text_full instances. I came up with this after viewing your image in Paint.

  #----------------------------------------------------------------------------
  # draw
  #  Draws the recharge sectors over the hotkey display.
  #----------------------------------------------------------------------------
  def draw(index = nil)
    # iterate through all skills that need to be recharged
    (@skillrecharge).each {|i|
      # temporary var
      object = $data_skills[$game_player.skill_hotkeys[i%10]]
      ind = $game_player.skill_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(30*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(30*(i-1), 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(30*(i-1), 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(30*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @skillrecharge.delete(i)
      end}
    # iterate through all items that need to be recharged
    (@itemrecharge).each {|i|
      # temporary var
      object = $data_items[$game_player.item_hotkeys[i%10]]
      ind = $game_player.item_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(30*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(30*(i-1), 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(30*(i-1), 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(30*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @itemrecharge.delete(i)
      end}
  end

I'll take a look at that problem. I don't think anyone else would be willing to help figure it out anyways :'_':

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

August 15, 2013, 09:03:59 pm #36 Last Edit: August 15, 2013, 09:05:07 pm by Shalaren
I need to move it in the X value by 1 I think as it sticks out a bit, where do I find that?
I'm at this line
self.bitmap.fill_rect(30*(i-1), 1, len, 8, Color.new(255, 255, 0))

The 1 by ,len moves in by Y value, where the x then?

and haha thanks xD

Zexion


Shalaren

ok thanks!  :P
KK20 let me know if you find out what causes Items not to work.

Thank you guys!  :haha: :haha: :haha:

KK20

Figured it out.

#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# Blizz-ABS Action Recharge Time by Winkio
# Version: 1.11
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
#
#
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
# This script modifies the Blizz-ABS system to allow for recharge times.  These
# times are graphically represented on the hotkey bar
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
module BlizzABS
  #-----------------------------------------------------------------------------
  # configure recharge times like everything else.
  # put in the number of frames (40 = 1 second)
  #-----------------------------------------------------------------------------
  module Weapons
    def self.recharge(id)
      case id
      when 1 then return 0
      end
      return 0
    end
  end
  module Skills
    def self.recharge(id)
      case id
      when 1 then return 800
      end
      return 800
    end
  end
  module Items
    def self.recharge(id)
      case id
      when 1 then return 40
      end
      return 200
    end
  end
  module Enemies
    def self.recharge(id)
      case id
      when 1 then return 0
      end
      return 0
    end
  end
end

class Map_Battler
  attr_reader :recharge
  attr_reader :rechcounter
  attr_reader :rechcheck
 
  #----------------------------------------------------------------------------
  # Initialize
  #----------------------------------------------------------------------------
  alias initialize_recharge_later initialize
  def initialize
    @rechcounter = [0, 0] #attack, defend
    (0...999).each {|i| @rechcounter.push(0)} #500 skills and 500 items
    @recharge = @rechcounter.clone
    @recheck = []
    initialize_recharge_later
  end
  #----------------------------------------------------------------------------
  # Recharging
  #----------------------------------------------------------------------------
  def recharging?(index)
    return (@rechcounter[index] > 0)
  end
  #----------------------------------------------------------------------------
  # Recharge Rate
  #----------------------------------------------------------------------------
  def rech_rate(index)
    return 0.0 if @recharge[index] == 0
    return (@rechcounter[index].to_f/@recharge[index].to_f)
  end
  #----------------------------------------------------------------------------
  # attack_can_use?
  #----------------------------------------------------------------------------
  alias attack_can_use_recharge_later? attack_can_use?
  def attack_can_use?
    return (!recharging?(0) && attack_can_use_recharge_later?)
  end
  #----------------------------------------------------------------------------
  # skill_can_use?
  #----------------------------------------------------------------------------
  alias skill_can_use_recharge_later? skill_can_use?
  def skill_can_use?(id, forced = false)
    return (!recharging?(1+id) && skill_can_use_recharge_later?(id, forced))
  end
  #----------------------------------------------------------------------------
  # item_can_use?
  #----------------------------------------------------------------------------
  alias item_can_use_recharge_later? item_can_use?
  def item_can_use?(id, forced = false)
    return (!recharging?(501+id) && item_can_use_recharge_later?(id, forced))
  end
end

class Map_Actor
  #----------------------------------------------------------------------------
  # Update
  #----------------------------------------------------------------------------
  alias upd_recharger_later update
  def update
    @recheck.each {|i|
      if recharging?(i)
        @rechcounter[i] -= 1
      else
        @recheck.delete(i)
      end}
    upd_recharger_later
  end
  #----------------------------------------------------------------------------
  # Attack Penalty
  #----------------------------------------------------------------------------
  alias attack_penalty_recharger_later attack_penalty
  def attack_penalty
    re = BlizzABS::Weapons.recharge(@battler.weapon_id)
    @recharge[0], @rechcounter[0] = re, re
    @recheck.push(0)
    return attack_penalty_recharger_later
  end
  #----------------------------------------------------------------------------
  # Skill Penalty
  #----------------------------------------------------------------------------
  alias skill_penalty_recharger_later skill_penalty
  def skill_penalty(id)
    re = BlizzABS::Skills.recharge(id)
    @recharge[1+id], @rechcounter[1+id] = re, re
    @recheck.push(1+id)
    return skill_penalty_recharger_later(id)
  end
  #----------------------------------------------------------------------------
  # Item Penalty
  #----------------------------------------------------------------------------
  alias item_penalty_recharger_later item_penalty
  def item_penalty(id)
    re = BlizzABS::Items.recharge(id)
    @recharge[501+id], @rechcounter[501+id] = re, re
    @recheck.push(501+id)
    return item_penalty_recharger_later(id)
  end
end


class Map_Enemy
  #----------------------------------------------------------------------------
  # Update
  #----------------------------------------------------------------------------
  alias upd_recharger_later update
  def update
    @recheck.each {|i|
      if recharging?(i)
        @rechcounter[i] -= 1
      else
        @recheck.delete(i)
      end}
    upd_recharger_later
  end
  #----------------------------------------------------------------------------
  # Attack Penalty
  #----------------------------------------------------------------------------
  alias attack_penalty_recharger_later attack_penalty
  def attack_penalty
    re = BlizzABS::Enemies.recharge(@battler.weapon_id)
    @recharge[0], @rechcounter[0] = re, re
    @recheck.push(0)
    return attack_penalty_recharger_later
  end
  #----------------------------------------------------------------------------
  # Skill Penalty
  #----------------------------------------------------------------------------
  alias skill_penalty_recharger_later skill_penalty
  def skill_penalty(id)
    re = BlizzABS::Skills.recharge(id)
    @recharge[1+id], @rechcounter[1+id] = re, re
    @recheck.push(1+id)
    return skill_penalty_recharger_later(id)
  end
  #----------------------------------------------------------------------------
  # Item Penalty
  #----------------------------------------------------------------------------
  alias item_penalty_recharger_later item_penalty
  def item_penalty(id)
    re = BlizzABS::Items.recharge(id)
    @recharge[501+id], @rechcounter[501+id] = re, re
    @recheck.push(501+id)
    return item_penalty_recharger_later(id)
  end
end



class Hotkey_Assignment < Sprite
 
  attr_accessor :recharge
  alias initialize_recharge_later initialize
  def initialize(viewport = nil)
    initialize_recharge_later(viewport)
    @recharge = Hotkey_Assignment_Recharge.new(self.x, self.y, self.z)
   
  end
  #----------------------------------------------------------------------------
  # update
  #  Updates the hotkey display.
  #----------------------------------------------------------------------------
  alias update_recharge_later update
  def update
    update_recharge_later
    if @recharge != nil
      @recharge.update
    end
  end
  #----------------------------------------------------------------------------
  # dispose
  #  Removes recharge time graphics from screen and memory.
  #----------------------------------------------------------------------------
  alias dispose_recharge_later dispose
  def dispose
    @recharge.dispose
    dispose_recharge_later
  end
end

class Hotkey_Assignment_Recharge < Sprite
 
  attr_reader :skillrecharge
  attr_reader :itemrecharge
  attr_reader :chargebitmaps
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(x0, y0, z0, viewport = nil)
    # call superclass
    super(viewport)
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font name
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # set font to bold
    self.bitmap.font.bold = true
    # set x and y position
    self.x, self.y, self.z = x0, y0, z0+100
    # update display
    @actor = $game_player.battler
    @skillrecharge = []
    @itemrecharge = []
    (1...10).each {|i|
        @skillrecharge.push(i)
        @itemrecharge.push(i)}
    update
  end
  #----------------------------------------------------------------------------
  # draw
  #  Draws the recharge sectors over the hotkey display.
  #----------------------------------------------------------------------------
  def draw(index = nil)
    # iterate through all skills that need to be recharged
    (@skillrecharge).each {|i|
      # temporary var
      object = $data_skills[$game_player.skill_hotkeys[i%10]]
      ind = $game_player.skill_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @skillrecharge.delete(i)
      end}
    # iterate through all items that need to be recharged
    (@itemrecharge).each {|i|
      # temporary var
      object = $data_items[$game_player.item_hotkeys[i%10]]
      ind = $game_player.item_hotkeys[i%10]+501
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @itemrecharge.delete(i)
      end}
  end
  #----------------------------------------------------------------------------
  # update
  #  Updates the hotkey display.
  #----------------------------------------------------------------------------
  def update
    if @actor != $game_player.battler
      # set new actor
      @actor = $game_player.battler
      @skillrecharge = []
      @itemrecharge = []
      self.bitmap.fill_rect(0, 0, 320, 32, Color.new(0, 0, 0, 0))
      (1...10).each {|i|
        @skillrecharge.push(i)
        @itemrecharge.push(i)}
      draw
    end
    draw if test_recharge
  end
  #----------------------------------------------------------------------------
  # test_recharge
  #  Updates the hotkey display.
  #----------------------------------------------------------------------------
  def test_recharge
    BlizzABS::Cache::HotkeyRange.each {|i|
      if $game_player.skill_hotkeys[i%10] != 0 and !@skillrecharge.include?(i)
        ind = $game_player.skill_hotkeys[i%10]+1
        if $game_player.recharging?(ind)
          @skillrecharge.push(i)
          return true
        end
      elsif $game_player.item_hotkeys[i%10] != 0 and !@itemrecharge.include?(i)
        ind = $game_player.item_hotkeys[i%10]+501
        if $game_player.recharging?(ind)
          @itemrecharge.push(i)
          return true
        end
      end}
    return false if @skillrecharge.size < 1 and @itemrecharge.size < 1
    return true
  end
  #----------------------------------------------------------------------------
  # bitmap_square_sect
  #  w          - width
  #  rate       - fill rate
  #  color    - color
  #  Draws the HUD gradient bar.
  #  This was going to be used a recharge graphic, but it lagged.  I included
  #  the code in case someone ever wanted to use it or fixes the lag.
  #----------------------------------------------------------------------------
  def bitmap_square_sect(w, rate)
    b = Bitmap.new(w, w)
    return b if rate <= 0.0 or rate > 1.0
    color = Color.new(0, 0, 0, 127)
    (0...23).each {|x|
      (0...23).each {|y|
        angle = (Math.atan2(x-w/2, y-w/2) + 6*Math::PI/2)%(2*Math::PI)
        b.set_pixel(x, y, color) if angle <= 2*Math::PI*rate}}
    return b
  end
end

It was forgetful programming. Just needed to change a couple +1 to +501. I'll go fix that in script's post.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!