Help - Search - Members - Calendar
Full Version: [Sub]Hud of Awesome
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
lilcooldude69
Hud of Awesome


Version: 1.0
Author: lilcooldude69
Release Date: Nov 04, 2010

Introduction
A Hud that Shows..Actor name,Actor level, Actor HP, Actor HP Bar, Actor MP, Actor MP Bar, Actor Exp Bar (no value of exp), Gold, Inflicted States, Face Graphic, And Actor Character Sprite


Features
Lol I have one You can turn it on and off with a switch to your liking its in the Module Section of the Script

Script
Script of Awesome
CODE

#==============================================================================
# **Basic Hud w/all information
# *Author: lilcooldude69
#------------------------------------------------------------------------------
# P.S. this is my first script so be nice :c
#==============================================================================

#==============================================================================
class Game_Actor
def maxexp
return @exp_list[@level +1]
end
end
class Window_Noobhud < Window_Base
Switch = 1 # Switch = "number of the switch to turn off the hud or turn it on"
Exp = "E" # Exp = "Experience term"
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 192, 160)
create_contents
self.visible = $game_switches[Switch]
@actor = $game_party.members[0]
refresh
end
def draw_actor_exp_gauge(actor, x, y, width = 120)
gw = width * actor.exp / actor.maxexp
gc1 = text_color(21) # Exp bar color 1
gc2 = text_color(17) # Exp bar color 2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def draw_actor_exp(actor, x, y, width = 30)
self.contents.font.color = system_color
self.contents.draw_text(x, y, width, WLH, Exp)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
self.back_opacity = 70
@name = @actor.name
@level = @actor.level
@hp = @actor.hp
@mp = @actor.mp
@exp = @actor.exp
@gold = $game_party.gold
@face = [@actor.face_name, @actor.face_index]
# comment out (# at the start of the line) if you don't want them to appear
draw_actor_face_picture(@actor, 0, 0, 100, 94) # Actor face
draw_actor_name(@actor, 0, 0) # Actor name
draw_actor_level(@actor, 0, 20) # Actor level
draw_actor_exp_gauge(@actor, 0, 72, 160) # Exp bar
draw_actor_exp(@actor, 0, 72, 30) # Exp term
draw_currency_value(@gold, 0, 50, 160) # Money
draw_actor_hp_gauge(@actor, 60, 0, 100) # Hp bar
draw_actor_hp(@actor, 60, 0, 100) # Hp term
draw_actor_mp_gauge(@actor, 60, 20, 100) # Mp bar
draw_actor_mp(@actor, 60, 20, 100) # Mp term
draw_actor_graphic(@actor, 16, 128) # Actor sprite
draw_actor_state(@actor, 40, 100, 96) # Actor states
# -------------------------------------------------------------------------
end
def draw_actor_face_picture(actor, x, y, opacity, size = 94)
bitmap = Cache.face(actor.face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = actor.face_index % 4 * 96 + (96 - size) / 2
rect.y = actor.face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect, opacity)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Update keeps things upto date and refreshes the data
#--------------------------------------------------------------------------
def update
self.visible = $game_switches[Switch]
return if !self.visible
if @level != @actor.level or @hp != @actor.hp or @exp != @actor.exp or
@mp != @actor.mp or @gold != $game_party.gold
refresh
end
end
end
#--------------------------------------------------------------------------
# * Scene_Map to keep it on when you turn it on
#--------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias start_window start
alias term_window terminate
alias update_window update
def start
start_window
@winhud = Window_Noobhud.new
end
def terminate
@winhud.dispose
term_window
end
def update
update_window
@winhud.update
end
end


ScreenShot


Compatiblility
Rpg Maker VX

Installation
Place Above main or in materials, edit the Switch part of the Module and enjoy smile.gif

Terms of Use
It would be nice if you Credited me but if you don't want to thats okay but only for non commercial, NO COMMERCIAL USE

Coming soon...
maybe....Request for me to add something and i'll see what i can do, dont expect a flippin abs battle system inside it though D:< im a noob scripter but sure request ne ways


Author Comments
My inspiration was SojaBird biggrin.gif Most of my help in this scripting came from his hud scripts so thank you soja bird, and My learning process came from Law's script tuts but mostly To Ccoa her tutorial is what made me catch on almost instantly as soon as i read the line about class inheritance any ways enjoy, A credit would be nice but it is not neccesary, NON-Commercial use once again i can't stress this enough >_>
leongon
Thumbs up for the awesome.
stripe103
I like the name of the HUD class. Noobhud.. funny biggrin.gif
Kread-EX
Okay, I'll be nice.

This...
CODE
module Hud_Switch
Switch = 1 #the switch that is used to turn the hud on or off
end
...is inefficient. You need one single constant to determine the switch ID, so you can shove it into the Noobhud class directly rather than creating a whole new module just for it.

Other than that, I don't see a problem. This is all good.
lilcooldude69
QUOTE (Kread-EX @ Nov 4 2010, 12:31 PM) *
Okay, I'll be nice.

This...
CODE
module Hud_Switch
Switch = 1 #the switch that is used to turn the hud on or off
end
...is inefficient. You need one single constant to determine the switch ID, so you can shove it into the Noobhud class directly rather than creating a whole new module just for it.

Other than that, I don't see a problem. This is all good.

ohhh D: i didnt know that i just always saw a module whenever their was customization :c so i made a module instead

Edit: i just realized that its not gonna work on anyone elses vx unless they put the neccesary things inside their window_base sigh i tried inserting those inside the script but it just errors so actually this script is fail ._. if one of you guys wants to fix it go ahead u can take full credit for it lol idc i just wanted to try a little scripting, or one of the mods can delete it or sumthing since it doesnt work and i cant seem to fix it ._.
Kread-EX
I can't test it right now so I don't know what is missing. Can you post the modifications you made to Window_Base? It shouldn't be very hard to fix.
leongon
Fixed:
Click to view attachment


See how I used the alias on terminate... that way the hud does not appear on the screenshot for the background in battle.
Also added comments that help the "users" to customize the display.


And please, don't quit on the first problem you meet, or I'll go to your house and rape your mother, father, sister and dog. If you get stuck in something just go sleep to let your brain defragment what has learned.
lilcooldude69
QUOTE (leongon @ Nov 5 2010, 08:03 AM) *
Fixed:
Click to view attachment


See how I used the alias on terminate... that way the hud does not appear on the screenshot for the background in battle.
Also added comments that help the "users" to customize the display.


And please, don't quit on the first problem you meet, or I'll go to your house and rape your mother, father, sister and dog. If you get stuck in something just go sleep to let your brain defragment what has learned.

lol thanx you were right though i spent like soo long trying to fix it and i just got soo frustrated that i just stopped and didnt have any drive left to do it anymore thank you for fixing it though biggrin.gif u can take all the credit if u want D: i just did it for fun but thank you :3
leongon
I don't want any credit for it, just replace this fixed one with the one on your first post. Thanks.
dracoseeker1
This is great, all great. Before i use the script, is there an in-game configuration to, say, change the actor shown in the hud?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.