Solved

Started by Shalaren, August 16, 2010, 08:36:25 pm

Previous topic - Next topic

Shalaren

August 16, 2010, 08:36:25 pm Last Edit: August 28, 2010, 08:44:12 pm by shalaren metropolis
thank you nathmatt, you made a great hud for my game! ^^


if u want a hud, request one of ur own o:, dont use other's. your just making a game clone this way.

nathmatt

here

Spoiler: ShowHide
#==============================================================================
# Hud
#------------------------------------------------------------------------------
#  This class was modified to support SR display and modify the number of
#  skills left to use.
#==============================================================================

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 = BlizzABS::Config::DIRECT_HOTKEYS ? @hud_height - 28 : @hud_height
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # 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 = 480
    @original_height = @hud_height = 81
    @name_x, @name_y, @level_x, @level_y = 120, 10, 120, 30
    @hp_x, @hp_y, @sp_x, @sp_y = 0, 10, 0, 33
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    self.bitmap.fill_rect(0, 0, self.bitmap.width, self.bitmap.height,
        Color.new(0, 0, 0, 128))
    # 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
    # draw "LV"
    self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
    # if direct hotkey option is turned off
    unless BlizzABS::Config::DIRECT_HOTKEYS
      # draw "Skill:"
      self.bitmap.draw_text_full(@hot_x, @hot_y, 48, 20, 'Skill:')
      # draw "Item:"
      self.bitmap.draw_text_full(@hot_x+76, @hot_y, 48, 20, 'Item:')
    end
  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 + 32, @hp_y + 3, 114, 0, 'hud_green_bar', 1)
    # draw empty bars
    self.bitmap.gradient_bar_hud(@sp_x + 32, @sp_y + 3, 114, 0, 'hud_blue_bar', 2)
    # 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')
    # reset all flag variables
    @name = @level = @hp = @sp = @maxhp = @maxsp = @exp = @states = @skill =
        @skills_left = @item = @items_left = @gold = 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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_green_bar', 1)
    # 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, @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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
    # 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, @sp_y, 32, 20, $data_system.words.sp)
  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 = 160, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
 
end

class Minimap < Sprite
 
  def initialize
    # call superclass method
    super(Viewport.new(480, 360, 160, 120))
    # get autotile image from Blizz-ABS Cache
    @autotile = $BlizzABS.cache.image('minimap_autotile')
    # creates the passable floor map
    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
    # set all sprites visible
    self.visible = true
    # update
    update
  end
 
end
 
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

August 16, 2010, 11:02:22 pm #2 Last Edit: August 16, 2010, 11:09:02 pm by shalaren metropolis
aw man you put them exactly where I needed them, its great!
, Except you didnt add a exp bar ontop of the hotkeys
+ if there is a way to put the image instead of the black shadow background.
+ the part when u add skills to hotkeys is not set up.

Thank you though! Ill use what you made for now.

if you feel like doing it and you need the background picture let me know, Ill upload it X:

nathmatt

sorry about that it was kinda late when i made it will add the exp when i can and yea the plck would help you can pm me it if you dont want to post it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

ok and one more thing i forgot to tell u, you forgot to put the name of the map on the minimap

nathmatt

August 17, 2010, 11:09:24 am #5 Last Edit: August 17, 2010, 12:31:56 pm by nathmatt
i have finished it just need to know what you named the picture other wise it would say cant find picture Hud

edit: also the exp goes all the way across the hot keys did you want it like that or small like the others
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

August 17, 2010, 01:35:03 pm #6 Last Edit: August 17, 2010, 01:36:57 pm by shalaren metropolis
yeah all the way thats how I wanted it, to be long
and just name the picture as, "Hud_Back" I guess
and if there is more then 1 picture, just name it whatever and let me know whats the names

nathmatt

here

Spoiler: ShowHide
#==============================================================================
# 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
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # 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 = 640
    @original_height = @hud_height = 125
    @name_x, @name_y, @level_x, @level_y = 120, 80, 120, 100
    @hp_x, @hp_y, @sp_x, @sp_y = 0, 80, 0, 100
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
    @exp_x,@exp_y = 175, 70
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    bitmap = RPG::Cache.picture('Hud_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
    # draw "LV"
    self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
  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_name
  #  Draws the name display.
  #----------------------------------------------------------------------------
  def draw_name
    # set current variable
    @name = actor.name
    # set font color
    self.bitmap.font.color = Color.new(0, 255, 0)
    # draw actor's name
    self.bitmap.draw_text_full(@name_x, @name_y, 50, 20, @name)
  end
  #----------------------------------------------------------------------------
  # draw_level
  #  Draws the level display.
  #----------------------------------------------------------------------------
  def draw_level
    # set current variable
    @level = actor.level
    # set font color
    self.bitmap.font.color = normal_color
    # draw actor's level
    self.bitmap.draw_text_full(@level_x+20, @level_y, 20, 20, @level.to_s, 2)
  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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_red_bar', 1)
    # 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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
    # 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.gradient_bar_hud(@exp_x, @exp_y+3, 295, rate, 'hud_green_bar', 2)
    self.bitmap.font.color = normal_color
    percent = (rate * 100).to_i
    self.bitmap.draw_text_full(@exp_x+6, @exp_y, 145, 20,percent.to_s,2)
    self.bitmap.draw_text_full(@exp_x + 155, @exp_y, 150, 20,'%')
    self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 20, 'EXP')
  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
    hud_update
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end
 
  def test_name
    # draw new name if name has changed
    $game_temp.hud_refresh = true if actor.name != @name
  end
 
  def test_level
    # draw new level if level has changed
    $game_temp.hud_refresh = true if actor.level != @level
  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]
          $game_temp.hud_refresh = true
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # draw bitmap
            p 30*(i-1)
            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
 
end

class Minimap < Sprite
 
  def initialize
    # call superclass method
    super(Viewport.new(478, 358, 160, 120))
    # get autotile image from Blizz-ABS Cache
    @autotile = $BlizzABS.cache.image('minimap_autotile')
    # creates the passable floor map
    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
    draw_map_name
    # set all sprites visible
    self.visible = true
    # update
    update
  end
 
  #----------------------------------------------------------------------------
  # draw_map_name
  #  Draws the map name display.
  #----------------------------------------------------------------------------
  def draw_map_name
    # set font color
    self.bitmap.font.color = Color.new(255, 255, 255, 255)
    # draw actor's name
    self.bitmap.font.size = 16
    self.bitmap.draw_text_full(0, 100, 160, 20, $map_infos[$game_map.map_id],1)
  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, 640, 480)
    # 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, 128
    # 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
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

Ahh I love it! :D, but I found an error, try adding skills, it gives an error that says "0" o-o, anyway it lets me put to skills on one hot key, idk what u did. anyway try the scripit and ull see. other then that, Its great I I love you for doing this ! :D

nathmatt

fixed that was from testing

Spoiler: ShowHide
#==============================================================================
# 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
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # 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 = 640
    @original_height = @hud_height = 125
    @name_x, @name_y, @level_x, @level_y = 120, 80, 120, 100
    @hp_x, @hp_y, @sp_x, @sp_y = 0, 80, 0, 100
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
    @exp_x,@exp_y = 175, 70
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    bitmap = RPG::Cache.picture('Hud_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
    # draw "LV"
    self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
  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_name
  #  Draws the name display.
  #----------------------------------------------------------------------------
  def draw_name
    # set current variable
    @name = actor.name
    # set font color
    self.bitmap.font.color = Color.new(0, 255, 0)
    # draw actor's name
    self.bitmap.draw_text_full(@name_x, @name_y, 50, 20, @name)
  end
  #----------------------------------------------------------------------------
  # draw_level
  #  Draws the level display.
  #----------------------------------------------------------------------------
  def draw_level
    # set current variable
    @level = actor.level
    # set font color
    self.bitmap.font.color = normal_color
    # draw actor's level
    self.bitmap.draw_text_full(@level_x+20, @level_y, 20, 20, @level.to_s, 2)
  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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_red_bar', 1)
    # 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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
    # 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.gradient_bar_hud(@exp_x, @exp_y+3, 295, rate, 'hud_green_bar', 2)
    self.bitmap.font.color = normal_color
    percent = (rate * 100).to_i
    self.bitmap.draw_text_full(@exp_x+6, @exp_y, 145, 20,percent.to_s,2)
    self.bitmap.draw_text_full(@exp_x + 155, @exp_y, 150, 20,'%')
    self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 20, 'EXP')
  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
    hud_update
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end
 
  def test_name
    # draw new name if name has changed
    $game_temp.hud_refresh = true if actor.name != @name
  end
 
  def test_level
    # draw new level if level has changed
    $game_temp.hud_refresh = true if actor.level != @level
  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]
          $game_temp.hud_refresh = true
          # 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
 
end

class Minimap < Sprite
 
  def initialize
    # call superclass method
    super(Viewport.new(478, 358, 160, 120))
    # get autotile image from Blizz-ABS Cache
    @autotile = $BlizzABS.cache.image('minimap_autotile')
    # creates the passable floor map
    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
    draw_map_name
    # set all sprites visible
    self.visible = true
    # update
    update
  end
 
  #----------------------------------------------------------------------------
  # draw_map_name
  #  Draws the map name display.
  #----------------------------------------------------------------------------
  def draw_map_name
    # set font color
    self.bitmap.font.color = Color.new(255, 255, 255, 255)
    # draw actor's name
    self.bitmap.font.size = 16
    self.bitmap.draw_text_full(0, 100, 160, 20, $map_infos[$game_map.map_id],1)
  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, 640, 480)
    # 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, 128
    # 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
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


G_G

Its probably best to just cut the two pictures. Main because it'd be a pain in the ass to see if the color the player is standing on is transparent or not.

nathmatt

August 17, 2010, 08:17:09 pm #11 Last Edit: August 17, 2010, 09:05:14 pm by nathmatt
script
Spoiler: ShowHide
#==============================================================================
# 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
   @map_back = Map_Back.new
   # create bitmap
   self.bitmap = Bitmap.new(@hud_width, h)
   # set font
   self.bitmap.font.name = 'Arial'
   # set font size
   self.bitmap.font.size = 16
   # 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
   @name_x, @name_y, @level_x, @level_y = 120, 10, 120, 30
   @hp_x, @hp_y, @sp_x, @sp_y = 0, 10, 0, 30
   @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
   @exp_x,@exp_y = 175, 0
 end
 #----------------------------------------------------------------------------
 # draw_basic
 #  Draws the HUD template.
 #----------------------------------------------------------------------------
 def draw_basic
   # fill with grey rectangle
   bitmap = RPG::Cache.picture('Hud_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
   # draw "LV"
   self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
 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_name
 #  Draws the name display.
 #----------------------------------------------------------------------------
 def draw_name
   # set current variable
   @name = actor.name
   # set font color
   self.bitmap.font.color = Color.new(0, 255, 0)
   # draw actor's name
   self.bitmap.draw_text_full(@name_x, @name_y, 50, 20, @name)
 end
 #----------------------------------------------------------------------------
 # draw_level
 #  Draws the level display.
 #----------------------------------------------------------------------------
 def draw_level
   # set current variable
   @level = actor.level
   # set font color
   self.bitmap.font.color = normal_color
   # draw actor's level
   self.bitmap.draw_text_full(@level_x+20, @level_y, 20, 20, @level.to_s, 2)
 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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_red_bar', 1)
   # 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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
   # 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.gradient_bar_hud(@exp_x, @exp_y+3, 295, rate, 'hud_green_bar', 2)
   self.bitmap.font.color = normal_color
   percent = (rate * 100).to_i
   self.bitmap.draw_text_full(@exp_x+6, @exp_y, 145, 20,percent.to_s,2)
   self.bitmap.draw_text_full(@exp_x + 155, @exp_y, 150, 20,'%')
   self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 20, 'EXP')
 end

 alias hud_update update
 def update
   @map_back.update
   draw_basic  if $game_temp.hud_refresh
   $game_temp.hud_refresh ? draw_exp : test_exp if actor != nil
   hud_update
 end
 
 def dispose
   super
   @map_back.dispose
 end
 
 def test_exp
   draw_exp if actor.exp != @exp
 end
 
 def test_name
   # draw new name if name has changed
   $game_temp.hud_refresh = true if actor.name != @name
 end
 
 def test_level
   # draw new level if level has changed
   $game_temp.hud_refresh = true if actor.level != @level
 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]
         $game_temp.hud_refresh = true
         # 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
 
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
   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
   draw_map_name
   # set all sprites visible
   self.visible = true
   # update
   update
 end
 
 def draw_map_name
   # set font color
   self.bitmap.font.color = Color.new(255, 255, 255, 255)
   # draw actor's name
   self.bitmap.font.size = 16
   self.bitmap.draw_text_full(0, 100, 160, 20, $map_infos[$game_map.map_id],1)
 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, 640, 480)
   # 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, 128
   # 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
   super
   self.x ,self.y,self.z = 474, 356,5000
   self.bitmap = RPG::Cache.picture('Map_Back')
   cw = bitmap.width
   ch = bitmap.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.bitmap.blt(0, 0, bitmap, src_rect)
   @p = $game_player
 end
 
 def update
   @p = $game_player
   if @p.screen_x > self.vx && @p.screen_x < self.vx + self.vw &&
      @p.screen_y > self.vy && @p.screen_y < self.vy + self.vh
     self.opacity -= 25 if self.opacity > 80
   elsif self.opacity <= 255
     self.opacity += 25
   end
 end
 
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

oh its great! forgot one thing, the name of the map on the minimap,
hope its possible to do that

nathmatt

it did when i used it ?
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


cyclope

i tryed the script and the map name only shows in 20x15 maps, if you move the map name changes its position
Things I Hate

1. People who point at their wrist asking for the time... I know where my watch is pal, where the hell is yours? Do I point at my crotch when I ask where the toilet is?

2. People who are willing to get off their a** to search the entire room for the TV remote because they refuse to walk to the TV and change the channel manually.

3. When people say "Oh you just want to have your cake and eat it too". Damn Right! What good is cake if you can't eat it?

4. When people say "it's always the last place you look". Of course it is. Why the hell would you keep looking after you've found it? Do people do this? Who and where are they?

5. When people say while watching a film, "did ya see that?" No Loser, I paid $12 to come to the cinema and stare at the damn floor!

6. People who ask "Can I ask you a question?"... Didn't give me a choice there, did ya sunshine?

Blizzard

August 18, 2010, 04:49:26 pm #15 Last Edit: August 18, 2010, 04:50:53 pm by Blizzard
Nathmatt probably paint it on the minimap. xD Nathmatt, add another sprite over the minimap for the name instead. Also, you don't really need a good portion of that script. Many of the methods are already part of the default HUD.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

fixed
Spoiler: ShowHide
#==============================================================================
# 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
   # create bitmap
   self.bitmap = Bitmap.new(@hud_width, h)
   # set font
   self.bitmap.font.name = 'Arial'
   # set font size
   self.bitmap.font.size = 16
   # 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
   @name_x, @name_y, @level_x, @level_y = 120, 10, 120, 30
   @hp_x, @hp_y, @sp_x, @sp_y = 0, 10, 0, 30
   @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
   @exp_x,@exp_y = 175, 0
 end
 #----------------------------------------------------------------------------
 # draw_basic
 #  Draws the HUD template.
 #----------------------------------------------------------------------------
 def draw_basic
   # fill with grey rectangle
   bitmap = RPG::Cache.picture('Hud_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
   # draw "LV"
   self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
 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_name
 #  Draws the name display.
 #----------------------------------------------------------------------------
 def draw_name
   # set current variable
   @name = actor.name
   # set font color
   self.bitmap.font.color = Color.new(0, 255, 0)
   # draw actor's name
   self.bitmap.draw_text_full(@name_x, @name_y, 50, 20, @name)
 end
 #----------------------------------------------------------------------------
 # draw_level
 #  Draws the level display.
 #----------------------------------------------------------------------------
 def draw_level
   # set current variable
   @level = actor.level
   # set font color
   self.bitmap.font.color = normal_color
   # draw actor's level
   self.bitmap.draw_text_full(@level_x+20, @level_y, 20, 20, @level.to_s, 2)
 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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_red_bar', 1)
   # 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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
   # 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.gradient_bar_hud(@exp_x, @exp_y+3, 295, rate, 'hud_green_bar', 2)
   self.bitmap.font.color = normal_color
   percent = (rate * 100).to_i
   self.bitmap.draw_text_full(@exp_x+6, @exp_y, 145, 20,percent.to_s,2)
   self.bitmap.draw_text_full(@exp_x + 155, @exp_y, 150, 20,'%')
   self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 20, 'EXP')
 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
   hud_update
 end
 
 def test_exp
   draw_exp if actor.exp != @exp
 end
 
 def test_name
   # draw new name if name has changed
   $game_temp.hud_refresh = true if actor.name != @name
 end
 
 def test_level
   # draw new level if level has changed
   $game_temp.hud_refresh = true if actor.level != @level
 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]
         $game_temp.hud_refresh = true
         # 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
 
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
   hud_update
   @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, 640, 480)
   # 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, 128
   # 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('Map_Back')
   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
 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
   self.bitmap.draw_text_full(0,0, 160, 20, $map_infos[$game_map.map_id],1)
   @map = map
 end
 
 def update
   self.opacity = @map.opacity
 end
 
end


@blizzard the only things i added where the things i edited im sure i could have edited it differently but it works

edit: i realized what i did when he said it moved with the map
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

Yes Its perfect! :3!
*lvl up*
but I have another question, to whoever reads this,
is there a way in the EXP Bar to show the % and the amount? I mean like "50/100"
+ if you can put that it'll show how much gold I have where ever on the map, I realized how I can move it around in the scripit, so it doesnt matter where

nathmatt

here

you may want to play with the placement
Spoiler: ShowHide
#==============================================================================
# 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
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 16
    # 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
    @name_x, @name_y, @level_x, @level_y = 120, 10, 120, 30
    @hp_x, @hp_y, @sp_x, @sp_y = 0, 10, 0, 30
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
    @exp_x,@exp_y = 175, 0
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    bitmap = RPG::Cache.picture('Hud_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
    # draw "LV"
    self.bitmap.draw_text_full(@level_x, @level_y, 20, 20, 'LV')
  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_name
  #  Draws the name display.
  #----------------------------------------------------------------------------
  def draw_name
    # set current variable
    @name = actor.name
    # set font color
    self.bitmap.font.color = Color.new(0, 255, 0)
    # draw actor's name
    self.bitmap.draw_text_full(@name_x, @name_y, 50, 20, @name)
  end
  #----------------------------------------------------------------------------
  # draw_level
  #  Draws the level display.
  #----------------------------------------------------------------------------
  def draw_level
    # set current variable
    @level = actor.level
    # set font color
    self.bitmap.font.color = normal_color
    # draw actor's level
    self.bitmap.draw_text_full(@level_x+20, @level_y, 20, 20, @level.to_s, 2)
  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.gradient_bar_hud(@hp_x, @hp_y+3, 114, rate, 'hud_red_bar', 1)
    # 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.gradient_bar_hud(@sp_x, @sp_y+3, 114, rate, 'hud_blue_bar', 2)
    # 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.gradient_bar_hud(@exp_x, @exp_y+3, 295, rate, 'hud_green_bar', 2)
    self.bitmap.font.color = normal_color
    percent = (rate * 100).to_i
    self.bitmap.draw_text_full(@exp_x+60, @exp_y, 200, 20,
    "#{@exp} / #{actor.next_exp}")
    self.bitmap.draw_text_full(@exp_x+185, @exp_y, 145, 20,percent.to_s)
    self.bitmap.draw_text_full(@exp_x+200, @exp_y, 150, 20,'%')
    self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 20, 'EXP')
  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
    hud_update
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end
 
  def test_name
    # draw new name if name has changed
    $game_temp.hud_refresh = true if actor.name != @name
  end
 
  def test_level
    # draw new level if level has changed
    $game_temp.hud_refresh = true if actor.level != @level
  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]
          $game_temp.hud_refresh = true
          # 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
 
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
    hud_update
    @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, 640, 480)
    # 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, 128
    # 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('Map_Back')
    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
  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
    self.bitmap.draw_text_full(0,0, 160, 20, $map_infos[$game_map.map_id],1)
    @map = map
  end
 
  def update
    self.opacity = @map.opacity
  end
 
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

umm, it shows me how much exp I have in total and not how much exp I have for the lvl,
so like it can go to "2000/250"
with the fact that 2K is more then 250 xD.