just trying to edit a hud for blizz

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

Previous topic - Next topic

Shalaren

August 09, 2013, 11:20:47 pm Last Edit: August 09, 2013, 11:34:50 pm by Shalaren
ok so I have Gold show up with the hud, but right next to it I also want to have Achievement points to show right next to it...
The achievement points are a variable so I want to have it show how much of the variable does the party have...
I tried to do it myself but I don't understand scripts that much,

so this is what it has for the gold
Spoiler: ShowHide
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

so what do I need to change in that to show the variable instead of gold?

Edit:
I guess to make it simple, I want to know what would this be "@gold = $game_party.gold" if I want it to be the Variable ID:5 instead of gold
I tried "@gold = $game_Variables=5" but that didn't work since I don't script xD what would it be?

Edit:
Another thing this part "$data_system.words.gold" I understand draws the currency name in the game? if so, how do I change that part to show the variable name

Zexion

Can you show me the whole hud script lol

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)
    # 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 = 175, 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, 192)
    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 = @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
    @name.update
    @lvl.update
    hud_update
  end
 
  def dispose
    super
    @name.dispose
    @lvl.dispose
    @gold.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 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

Zexion

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 = $game_variables[5]
    # 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, 192)
    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
    @ach = $game_variables[5]
    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))
    # you need to change x/y  (x,y, width, height, obj, align)
    self.bitmap.draw_text_full(2,0, 120, 20,@ach,2)

  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @gold != $game_party.gold or @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


I can't test it without blizz abz, but it should work o.o

Shalaren


Zexion


Shalaren

Error with Blizz abs part 3 line 4723
cannot convert Fixnum into string

KK20

It's probably this:
self.bitmap.draw_text_full(2,0, 120, 20,@ach,2)

Missing a 'to_s'
self.bitmap.draw_text_full(2,0, 120, 20,@ach.to_s,2)

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


KK20

Just so that I know, what line is that error pointing to?

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!

Zexion

Error with Blizz abs part 3 line 4723
:(
You should just take the original script and fix add it because I fail l0l

KK20

Quote from: Zexion on August 10, 2013, 01:46:33 am
Error with Blizz abs part 3 line 4723

Well, yes, I know that :P
I mean what's the specific line of code. Trying to do this blind.

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

Line 4723
draw_text_shaded_later(xx, yy, w, h, text, a)}}

in blizz abs part 3

KK20

Quote from: KK20 on August 10, 2013, 12:49:21 am
It's probably this:
self.bitmap.draw_text_full(2,0, 120, 20,@ach,2)

Missing a 'to_s'
self.bitmap.draw_text_full(2,0, 120, 20,@ach.to_s,2)


Did you even make this change? I had to make a new project with Blizz-ABS v2.85 and Zexion's HUD fix to see what was going on. After making the above change, I was getting a different error, something along the lines of 'undefined method "update" for Fixnum:0'. Problem was pointing to @ach variable in class HUD.
:O.o: Zexion, what the heck would $game_variables[5].update even do?

So after deleting 2 lines, I came up with this:
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)
    # 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, 192)
    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
    @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
    @ach = $game_variables[5]
    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)
    # you need to change x/y  (x,y, width, height, obj, align)
    self.bitmap.draw_text_full(2,16, 120, 20,@ach.to_s,2)

  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @gold != $game_party.gold or @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

And it looked just fine.

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!

Zexion

LOL. I don't really know. I kinda just copied everything from @gold
Like a pro. :V

KK20

August 10, 2013, 04:12:00 pm #15 Last Edit: August 10, 2013, 04:17:55 pm by KK20
Spoiler: ShowHide



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

hmm it works but looks odd,
I just made a new thing by copying the gold
Spoiler: ShowHide
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 = Color.new(140,172,81)
   self.bitmap.draw_text_full(125,0, 20, 20, 'AP')
   self.bitmap.font.color = Color.new(140,172,81)
   # you need to change x/y  (x,y, width, height, obj, align)
   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

and moved it aside and it looks good :)
either way you guys helped a lot! "$game_variables[5]" is what I needed to know, wasn't sure what to write so it shows a variable.

I have another question tho... I named this " 'AP' " (Achievement points) instead of "$data_system.words.gold" which I understand shows the name of the currency in my database... can I make it so it shows an icon instead? or a picture?

for gold Ill make a coin show up instead of the currency name in my database, and for achievements something else instead 'AP'.

KK20


icon = RPG::Cache.icon('filename') # Gets the icon graphic. If icon file is gold.png, then you would just put 'gold'
self.bitmap.blt(x, y, icon, Rect.new(0, 0, 24, 24)) # Draws the icon to the bitmap. Just need to put in your x and y 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

August 11, 2013, 06:24:46 pm #18 Last Edit: August 11, 2013, 06:29:05 pm by Shalaren
I tried to put it into the script but I can't get it to work.
where does the
icon = RPG::Cache.icon('filename')
go?

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(x, y, icon, Rect.new(125, 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
 

this is the only thing I tried where the game doesnt crash, but I just dont see the icon ingame

Edit:
I want it the exact way it is now, just instead of 'AP' for this to be the icon
Spoiler: ShowHide
  def draw_text
    self.bitmap.clear
    @ach = $game_variables[5]
    self.bitmap.font.color = normal_color
    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)

Zexion

You can put it anywhere above the other line that he included. It's just defining icon.
icon = RPG::Cache.icon('filename')
self.bitmap.blt(x, y, icon, Rect.new(0, 0, 24, 24))