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.

new..Hp,SP,Exp Bar

Hello. I hade this script befor on another project. But when my computer crashed, i lost it all.. Ist was 1 player game.. so in in the bottom of the corner i had HP,SP, and a exp bar and a picture of the player. i use this as as a template. i will design a bether one but it will have the same measures..

http://i4.photobucket.com/albums/y131/T ... 1scopy.png[/IMG]


Also i hade a special menu.. it look kind of like this:

http://i4.photobucket.com/albums/y131/T ... /Hejen.png[/IMG]

That Mahime in the corner is the name of the hero.. it was just a project name i used befor,

The first request is the most importen one for my project so far.. Thx..
 
k working on it, but i need the character face...or...it is the battler or character sprite?

and about the menu, the center of the menu is white, what's supposed to go tehre?
 
ok this is what i have so far:

http://img157.imageshack.us/img157/9646 ... ed2lq9.png[/IMG]
hope you like it ^_^

here's the script:
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias tak_map_main main
alias tak_map_update update
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@hud_sprite = Window_HUD.new
@hud_window = Window_HUDFACE.new
tak_map_main
@hud_sprite.dispose
@hud_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@hud_sprite.update
tak_map_update
end
end


#=============================================================================
# ** Game_Actor
#-----------------------------------------------------------------------------
# This small edit is made to show characetr exp as a bar
#=============================================================================
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

#==============================================================================
# ** Window_HUDFACE
#------------------------------------------------------------------------------
# This window will draw the characters Image.-
#==============================================================================
class Window_HUDFACE < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-2, 360, 118, 124)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@actor = $game_party.actors[0]
suffix = "_face"
bitmap = RPG::Cache.picture(@actor.name + suffix)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
end
end
#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
# This window draws the HUD, with HP, SP and exp bar.
#==============================================================================
class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-15, 350, 320, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@actor = $game_party.actors[0]
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@old_hp = @actor.hp
@old_sp = @actor.sp
bitmap = RPG::Cache.picture("HUD")
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
draw_bar(135, 17, @actor.hp, @actor.maxhp, 135, 8, Color.new(150, 0, 0, 255), Color.new(255, 0, 0, 255))
draw_bar(135, 53, @actor.sp, @actor.maxsp, 135, 8, Color.new(0, 0, 150, 255), Color.new(0, 0, 255, 255))
draw_bar(135, 90, @actor.now_exp, @actor.next_exp, 135, 8, Color.new(0, 150, 0, 255), Color.new(0, 255, 0, 255))
self.contents.font.size = 18
self.contents.font.italic = true
self.contents.font.color = Color.new(0, 0, 0)
self.contents.draw_text(162, 11, 150, 32, "#{@actor.hp}/#{@actor.maxhp}")
self.contents.draw_text(164, 11, 150, 32, "#{@actor.hp}/#{@actor.maxhp}")
self.contents.draw_text(162, 9, 150, 32, "#{@actor.hp}/#{@actor.maxhp}")
self.contents.draw_text(164, 9, 150, 32, "#{@actor.hp}/#{@actor.maxhp}")
self.contents.draw_text(162, 48, 150, 32, "#{@actor.sp}/#{@actor.maxsp}")
self.contents.draw_text(164, 48, 150, 32, "#{@actor.sp}/#{@actor.maxsp}")
self.contents.draw_text(162, 46, 150, 32, "#{@actor.sp}/#{@actor.maxsp}")
self.contents.draw_text(164, 46, 150, 32, "#{@actor.sp}/#{@actor.maxsp}")
self.contents.draw_text(170, 83, 150, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
self.contents.draw_text(172, 83, 150, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
self.contents.draw_text(170, 85, 150, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
self.contents.draw_text(172, 85, 150, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
self.contents.draw_text(104, 4, 150, 32, "HP:")
self.contents.draw_text(106, 4, 150, 32, "HP:")
self.contents.draw_text(104, 6, 150, 32, "HP:")
self.contents.draw_text(106, 6, 150, 32, "HP:")
self.contents.draw_text(104, 41, 150, 32, "SP:")
self.contents.draw_text(106, 41, 150, 32, "SP:")
self.contents.draw_text(104, 43, 150, 32, "SP:")
self.contents.draw_text(106, 43, 150, 32, "SP:")
self.contents.draw_text(104, 78, 150, 32, "XP:")
self.contents.draw_text(106, 78, 150, 32, "XP:")
self.contents.draw_text(104, 80, 150, 32, "XP:")
self.contents.draw_text(106, 80, 150, 32, "XP:")
self.contents.font.color = normal_color
self.contents.draw_text(105, 79, 150, 32, "XP:")
self.contents.draw_text(171, 84, 150, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
self.contents.font.color = @actor.hp <= @actor.maxhp / 4 ? crisis_color :
@actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(163, 10, 150, 32, "#{@actor.hp}/#{@actor.maxhp}")
self.contents.font.color = @actor.sp == 0 ? crisis_color : normal_color
self.contents.draw_text(163, 47, 150, 32, "#{@actor.sp}/#{@actor.maxsp}")
self.contents.draw_text(105, 5, 150, 32, "HP:")
self.contents.draw_text(105, 42, 150, 32, "SP:")
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if @old_hp != $game_party.actors[0].hp or
@old_sp != $game_party.actors[0].sp or
@old_exp != $game_party.actors[0].now_exp
refresh
@old_hp = $game_party.actors[0].hp
@old_sp = $game_party.actors[0].sp
@old_exp = $game_party.actors[0].now_exp
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x, y + height - i, width, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i - 1, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
#=========================
# THE END
#=========================

well...that's the script for the HUD, if you need need instructions, or need something to be fixed, just post back, and...ummm...credit raziel (because i learned a lot from him) and sephirothspawn (for the bars)
 
umm...actually this is a special request by snowbear, but i can make you a custom HUD if you want, just post it here in the request section, telling us how you want theHUD to be.-
 
Well.. man thx... =) yeay...

and... i need some guiding.. it has been awhile since i used RMXP... Where and ow shuld i put the script.. like is there just to add to the sript or write over?... maby some part that neeed to be repleced by you script..

also my rmxp there is just llot of squere boxes insted of text in the script page.. i think it should be japanese there, becuse my computer do tat when there is japanese.
 
square boxes? that's weird, maybe .... damn.... (i hope you are using a legal version of RMXP man.)

How to add
open your script editor (f11) and click on main with left click, then select Insert.
then name it Snowbear HUD and inside, paste the script i put on the post above.

How to use
you need this image in your pictures folder:
http://i21.photobucket.com/albums/b295/Takneo/HUD.png[/IMG]
must be called HUD

and...ohh yeah, to see the character face, your image must be called like your character name, plus the suffix "_face" this means that if your character name is aluxes, then the picture must be called "Aluxes_face" well...if you want you can also change the suffix, just search for this line:

@actor = $game_party.actors[0]
suffix = "_face"

ok that's all...hope it helps...
 
oh Yes!.. thats.. great.. if you can.. can you just fil the gap or something.. so the background doesent show.. then i want to be able to add a picture. like a wallpaper that will be behind all (so the me menu most be trasparent, but that might be done wih windowskin)... And a really great.. job... =)

Edit:

Well i most say sorry, for that i took so long to answarer.
 
ok...and...
1) i can make it have an image background, so don't worry about that
2) do you intend to make the windowskin opacity to 0?
3) do you want the battler and name windows change depending on the character selection? or is your game a 1 player game?
4) don't worry about the late answer, i'm happy you liked it.
 
1) Good
2) Yes
3) well i will probleby have a one player game.. yes i will do.. (im working on 2 prjects at the same time, on personal and one with a friend) but my will be one player..
4) Again im late, but i have been away and my internet time has been limited..
 

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