[XP] EXP in HUD for Blizz-ABS

Started by Blizzard, December 01, 2008, 05:37:53 am

Previous topic - Next topic

Blizzard

December 01, 2008, 05:37:53 am Last Edit: March 23, 2019, 11:37:58 am by Blizzard
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


  • adds an EXP bar in the HUD
  • fully compatible with CRLS
  • lagfree because of full integration into Blizz-ABS advanced and lagfree HUD System.



Screenshots




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


  • Boris "Blizzard" Mikić



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
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.

G_G

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?

Blizzard

Does the ghost give any EXP? The plugin works fine for me.
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.

G_G

oh woops sorry lol i had the ghost experience set to zero when i meant to set gold sorry blizz

Blizzard

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.

dylanf3

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?

Aqua

Just have a blank actor for the start of the game.

dylanf3

Yeah, but that shows HP, exp and MP etc, its not neat......  :shy:

winkio

idea:  turn the HUD off at the start of the game, then turn it on again once you get a party.

Blizzard

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.

Sylphe

August 02, 2014, 06:10:21 pm #10 Last Edit: August 02, 2014, 11:43:54 pm by Sylphe
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 !
blindly follow his heart can lead to the loss

Sylphe, descendant of Zoldik Family.
Quote from: TedBearTRY KEEP UP