Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

DeM0nFiRe's KH Health Bar

I don't know what your talking about... But I would copy my scripts out of the demo because DF's was a bit buggy. If that doesn't work, then elaborate a little and I can probably make something work.
 
The script is defaulted to have 61-100 percent be the curved part, you can't do that?

As for making multiple bars, here's what you do(replace # with the number bar it is):
Code:
@healthbar# = Sprite_KHBar.new
@Healthbar#.x = (#-1) * 200
 
@Sasuke89:
I can?t copy the Bar System out of your Demo, because it?s running reversed ( Your Bars is getting emptier from the curve to the rectangle-Bar )..

But i need the Curved Bar getting emtier first, before the rectangle.

@DeM0nFiRe:
I copied the Bar-Script 3 Times and changed the name and Sprite numbers.. so i can call them like i need them ^^.
 
Sir Lord Biowulve;250013 said:
@Sasuke89:
I can?t copy the Bar System out of your Demo, because it?s running reversed ( Your Bars is getting emptier from the curve to the rectangle-Bar )..

But i need the Curved Bar getting emtier first, before the rectangle.

@DeM0nFiRe:
I copied the Bar-Script 3 Times and changed the name and Sprite numbers.. so i can call them like i need them ^^.

Yup it's reverse alright....can you fix that Sasuke?
 
Alright guys, I'll start working on v2 of this script. here are some features I plan on including for v2:
-Draws entire bar for you
-HP numerals displayed
-Character Graphic Displayed in curve of bar
-Graphic for empty bar that will be replaced automatically by your own background if you put one
-Better looking
-Built-in support for multiple bars
 
I do still plan on making a new version of this, however it will take some time. I've got alot of stuff to work on now. Really sorry for the delay.
 
Yeah, I'm really sorry but I've got a zillion projects I have to work on. I would seriously reccomend going with one of the other KH Huds that are around (use the Forum Script Listing) This one I made is really poorly done. If you'd like, PM me and I can make another HUD for you that'll be better quality.
 
Like I said, this was my first released script, and it's very poorly coded. I just have been too busy to update it. I'm sorry for any inconvenience this causes anyone.
 
Well, I'm still not that advanced of a scripter, but wouldn't it be a bit more organized to use

when 1...100
self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
end

instead?  I know this was your first script but it would be nice to make a few revisions to it and I'm a bit too lazy to go upstairs turn on my laptop and try it out right now.

Code:
################################################################################
#Title: Kingdom Hearts Health Bar V1.0 (07/16/07)                              #
#------------------------------------------------------------------------------#
#Scripter: DeM0nFiRe                                                           #
#------------------------------------------------------------------------------#
#To Use: 1.Put "@healthbar = Sprite_KHBar.new" right below "@message_window =  #
#                      Window_Message.new" in Scene_Map                        #
#        2.Put "@healthbar.update" right below "loop do" in Scene_Map          #
#        3.Play!                                                               #
#------------------------------------------------------------------------------#
#To Install: Insert this script above main. Then you must make pictures for the#
#curved part of the bar at 61-100%. These pictures should be named "KH_x" where#
#where xx is the percent. the next version of the script will draw the curve   #
#for you, but I needed a version out now.                                      #
#------------------------------------------------------------------------------#
#NOTE!: To use this script non-commercially, you MUST credit DeM0nFiRe, To use #
#in a commercial project, please conatact DeM0nFiRe                            # 
################################################################################

class Sprite_KHBar < Sprite
#--------------------
  def initialize
    super
    self.bitmap = Bitmap.new(200, 200)
    self.x = 640 - self.bitmap.width
    self.y = 200
    self.z = 500
    @frame = $game_party.actors[0].hp * 100 / $game_party.actors[0].maxhp
    update
  end
#--------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    super
  end
#--------------------
  def update
    color = Color.new(36, 185, 63)
    @frame = $game_party.actors[0].hp * 100 / $game_party.actors[0].maxhp
    case @frame.round
    when 1...100
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    end
  end
end

Now if this version works, it would be more efficent since it isn't running through the whole script looking for the right one, instead it just runs through one function looking for the right variable.  Not only that, but it wouldn't be refreshing every frame so that would lessen lag.  If you want though, I could make the hud in my spare time tomorrow since I have nothing else to do and it's getting a little late over here.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top