Game:RPG XP
Blizz ABS: 2.8
I post a topic on RRR on how to change the EXP Meter on the HUD To the current Weapon and it Works but there are to problems.
The person who help me said there may be error but he was un sure of what they would be.
The first One is; when you use the quick weapon change, the name of the weapons over lap each other and do not replace.
the only work around i have to this is to keep going on to the menu to make it refresh
The Second one is if you do not have a weapon equip it causes the game to crash with the error message;
Line 49: NoMethodError occurred
undefined method 'name' for nil:NilClass
This is the edited script
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
if !$BlizzABS || BlizzABS::VERSION < 2.7
raise 'ERROR: The "EXP in HUD" requires Blizz-ABS 2.7 or higher.'
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# word displayed for EXP
EXP_WORD = 'WPN'
#==============================================================================
# Hud
#==============================================================================
class Hud
alias create_positions_expinhud_later create_positions
def create_positions
create_positions_expinhud_later
@exp_x, @exp_y = 4, 49# + @hud_height - @original_height
@hud_height += 16
@hot_y += 16
@left_y += 16
end
alias draw_basic_expinhud_later draw_basic
def draw_basic
draw_basic_expinhud_later
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
self.bitmap.fill_rect(@exp_x+32, @exp_y+3, 116, 14, color) if
color.is_a?(Color)
self.bitmap.fill_rect(@exp_x, @exp_y, 32, 20,
Color.new(0, 0, 0, 128))
self.bitmap.font.color = system_color
self.bitmap.draw_text_full(@exp_x, @exp_y, 80, 20, EXP_WORD)
self.bitmap.font.color = normal_color
end
def draw_empty
return
end
def draw_exp
self.bitmap.font.color = normal_color
self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, $data_weapons[$game_party.actors[0].weapon_id].name, 2)
end
alias upd_expinhud_later update
def update
redraw_weapon = ($game_temp.hud_refresh |= test_refresh)
upd_expinhud_later
draw_exp if redraw_weapon
end
def test_refresh
@lastWeaponID = -1 if @lastWeaponID.nil?
needs_refresh = @lastWeaponID != $game_party.actors[0].weapon_id
@lastWeaponID = $game_party.actors[0].weapon_id
return needs_refresh
end
end
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=