Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on December 01, 2008, 05:37:53 am

Title: [XP] EXP in HUD for Blizz-ABS
Post by: Blizzard on December 01, 2008, 05:37:53 am
EXP in HUD for Blizz-ABS
Authors: Blizzard
Version: 1.01b
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin



Introduction

This script will add an EXP bar into Blizz-ABS's default HUD. It will appear under or over the SR bar if you are using CRLS depending on where you insert this plugin.

This script is to be distributed under the same terms and conditions like the script it was created for: Blizz-ABS.


Features




Screenshots

(http://img122.imageshack.us/img122/6017/snap345zb8.th.png) (http://img122.imageshack.us/img122/6017/snap345zb8.png) (http://img122.imageshack.us/img122/513/snap346ig3.th.png) (http://img122.imageshack.us/img122/513/snap346ig3.png)


Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# EXP in HUD for Blizz-ABS by Blizzard
# Version: 1.01b
# Type: Blizz-ABS Add-on
# Date: 27.11.2008
# Date 1.01b: 23.2.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and requires Blizz-ABS v2.7 or
#   higher to work properly. It will add an EXP bar to the default HUD.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

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 = 'EXP'

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

$blizzabs_exp_in_hud = 1.01

#==============================================================================
# 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
 
  alias draw_empty_expinhud_later draw_empty
  def draw_empty
    draw_empty_expinhud_later
    self.bitmap.gradient_bar_hud(@exp_x + 32, @exp_y + 3, 114, 0, 'hud_white_bar')
    self.bitmap.font.color = disabled_color
    self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, '0', 2)
    @exp = nil
  end
 
  def draw_exp
    @exp = actor.exp
    rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
    self.bitmap.gradient_bar_hud(@exp_x + 32, @exp_y + 3, 114, rate, 'hud_white_bar')
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, actor.next_rest_exp_s, 2)
  end
 
  alias upd_expinhud_later update
  def update
    $game_temp.hud_refresh ? draw_exp : test_exp if actor != nil
    upd_expinhud_later
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end

end



Instructions

None required.


Compatibility

Requires Blizz-ABS to work. Fully compatible with the SR display from CRLS of the CRLS-Blizz-ABS plugin v1.1b or higher.


Credits and Thanks




Author's Notes

Keep in mind that this plugin comes UNDER Blizz-ABS. This script was done on request (so people stop asking) and is not fully supported by me as my other scripts are.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Title: Re: EXP in HUD for Blizz-ABS
Post by: G_G on December 01, 2008, 05:55:05 pm
nice add on too bad i cant use it for contest and one thing everytime i kill a ghost i dont get no experience for it. Do u know wats rong with it?
Title: Re: EXP in HUD for Blizz-ABS
Post by: Blizzard on December 01, 2008, 06:46:52 pm
Does the ghost give any EXP? The plugin works fine for me.
Title: Re: EXP in HUD for Blizz-ABS
Post by: G_G on December 01, 2008, 08:23:29 pm
oh woops sorry lol i had the ghost experience set to zero when i meant to set gold sorry blizz
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: Blizzard on December 04, 2008, 10:49:37 am
I put up two screenshots. :3
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: dylanf3 on July 07, 2009, 05:44:48 pm
Man... ive got a problem with this, if i start with no characters in the party, like in the start of my game, i get a error... which kinda sux cuz i cant use it in my game, is there a fix for that?
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: Aqua on July 07, 2009, 05:53:07 pm
Just have a blank actor for the start of the game.
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: dylanf3 on July 07, 2009, 06:04:37 pm
Yeah, but that shows HP, exp and MP etc, its not neat......  :shy:
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: winkio on July 07, 2009, 06:08:39 pm
idea:  turn the HUD off at the start of the game, then turn it on again once you get a party.
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: Blizzard on February 23, 2010, 02:19:26 am
Update to v1.01b.
Title: Re: [XP] EXP in HUD for Blizz-ABS
Post by: Sylphe on August 02, 2014, 06:10:21 pm
Necropost ALERT !
Well the exp bar doesn't refresh when I get exp, I have to change the scene then go back to scene_map in order to refresh it, any clue ?

EDIT : Ok fixed ! Sorry for necro !