Version 1.1
Author: Kendorei
Released: 1/8/09
Exclusive to RPG RPG Revolution. (Not that it's difficult to make.

)
The script is just a simple HUD that can be easily adjusted and used without having to use a CBS.
It's easy to change what it shows in it, and can be used with an in-game Switch and Variable.
Features of the standard script:
1.) Shows the actor's Sprite
2.) Shows the actor's current and max HP
3.) Shows the actor's current and max SP
4.) Shows the actor's current EXP and the EXP required for Level-Up
5.) Shows the actor's Level
6.) Shows the actor's Class
7.) Shows the party's current amount of Gold
8.) Shows the actor's Name
9.) Can be turned on and off via an in-game Switch
10.) Can change which actor is displayed via an in-game Variable
11.) Can show a blank HUD window for an invalid variable (like an empty party slot).
CODE
#-------------------------------------------------------------------------------
# Simple HUD (Heads-Up Display) v1.1
#-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
# Created by Kendorei
#-------------------------------------------------------------------------------
class Window_HUD < Window_Base
attr_accessor :actor
def initialize
super(0, 0, 160, 189)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 160 # This makes the HUD transparent
self.visible = $game_switches[1] # This toggles the HUD via a switch
@hud_variable = $game_variables[1] # This variable controls which party member is viewed
@actor = $game_party.actors[@hud_variable] # This makes the HUD display the actor in the corresponding party slot
if (@actor != nil)
@name = @actor.name # Actor's name
@class_name = @actor.class_name # Actor's class
@hp = @actor.hp # Actor's current HP
@maxhp = @actor.maxhp # Actor's max HP
@sp = @actor.sp # Actor's current SP
@maxsp = @actor.maxsp # Actor's max SP
@exp = @actor.exp # Actor's current exp
@nexp = @actor.next_exp_s # The exp required for a level-up
@level = @actor.level # Actor's current level
@gold = $game_party.gold # The amount of gold currently in possession
refresh
else
@gold = $game_party.gold # The amount of gold currently in possession
no_actor
end
end
#-------------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(40, 0, 80, 25, @name.to_s)
self.contents.draw_text(50, 25, 70, 20, @class_name.to_s)
self.contents.draw_text(50, 45, 70, 20, "HP: "+@hp.to_s+"/"+@maxhp.to_s)
self.contents.draw_text(50, 65, 70, 20, "SP: "+@sp.to_s+"/"+@maxsp.to_s)
self.contents.draw_text(50, 85, 70, 20, "EXP: "+@exp.to_s+"/"+@nexp.to_s)
self.contents.draw_text(50, 105, 70, 20, "Lvl "+@level.to_s)
self.contents.draw_text(40, 125, 80, 20, "Gold: "+@gold.to_s)
draw_actor_graphic(@actor, 10, 50)
end
#-------------------------------------------------------------------------------
def no_actor
self.contents.clear
self.contents.draw_text(30, 65, 65, 40, "Empty Slot")
self.contents.draw_text(40, 125, 80, 20, "Gold: "+@gold.to_s)
end
#-------------------------------------------------------------------------------
def update
if (@actor == nil)
self.visible = $game_switches[1]
@hud_variable = $game_variables[1]
@gold = $game_party.gold
no_actor
elsif (self.visible != $game_switches[1]) or
(@hud_variable != $game_variables[1]) or
(@class_name != @actor.class_name) or
(@hp != @actor.hp) or
(@maxhp != @actor.maxhp) or
(@sp != @actor.sp) or
(@maxsp != @actor.maxsp) or
(@exp != @actor.exp) or
(@level != @actor.level) or
(@gold != $game_party.gold)
self.visible = $game_switches[1] # This makes the HUD visible or invisible
@hud_variable = $game_variables[1] # This variable controls which party member is viewed
@actor = $game_party.actors[@hud_variable]
if (@actor != nil)
@name = @actor.name # Actor's name
@class_name = @actor.class_name # Actor's class
@hp = @actor.hp # Actor's current HP
@maxhp = @actor.maxhp # Actor's max HP
@sp = @actor.sp # Actor's current SP
@maxsp = @actor.maxsp # Actor's max SP
@exp = @actor.exp # Actor's current exp
@nexp = @actor.next_exp_s # The exp required for a level-up
@level = @actor.level # Actor's current level
@gold = $game_party.gold # The amount of gold currently in possession
refresh
else
@gold = $game_party.gold # The amount of gold currently in possession
no_actor
end
end
end
end
This can be customized quite easily by anyone with a little scripting experience.
I'm not sure of what can interfere with this code, but it'd be best to use this without a CBS that includes an HUD. I am not certain if the SDK is compatable, as I don't use the SDK at all. But, this HUD can be used for many different situations.
Version 1.1 DemoJust paste the script above Main and add the window to Scene_Map by putting this in
the Scene with the other similar lines:
@hud_window = Window_HUD.new@hud_window.dispose@hud_window.updateCODE
#-------------------------------------------------------------------------------
# Simple HUD (Heads-Up Display) v1.0
#-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
# Created by Kendorei
#-------------------------------------------------------------------------------
class Window_HUD < Window_Base
attr_accessor :actor
def initialize
super(0, 0, 160, 189)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 160 # This makes the HUD transparent
self.visible = $game_switches[1] # This toggles the HUD via a switch
@hud_variable = $game_variables[1] # This variable controls which party member is viewed
@actor = $game_party.actors[@hud_variable] # This makes the HUD display the actor in the corresponding party slot
@name = @actor.name # Actor's name
@class_name = @actor.class_name # Actor's class
@hp = @actor.hp # Actor's current HP
@maxhp = @actor.maxhp # Actor's max HP
@sp = @actor.sp # Actor's current SP
@maxsp = @actor.maxsp # Actor's max SP
@exp = @actor.exp # Actor's current exp
@nexp = @actor.next_exp_s # The exp required for a level-up
@level = @actor.level # Actor's current level
@gold = $game_party.gold # The amount of gold currently in possession
@graphic = @actor # The actor's sprite
refresh
end
#-------------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(40, 0, 80, 25, @name.to_s)
self.contents.draw_text(50, 25, 70, 20, @class_name.to_s)
self.contents.draw_text(50, 45, 70, 20, "HP: "+@hp.to_s+"/"+@maxhp.to_s)
self.contents.draw_text(50, 65, 70, 20, "SP: "+@sp.to_s+"/"+@maxsp.to_s)
self.contents.draw_text(50, 85, 70, 20, "EXP: "+@exp.to_s+"/"+@nexp.to_s)
self.contents.draw_text(50, 105, 70, 20, "Lvl "+@level.to_s)
self.contents.draw_text(40, 125, 80, 20, "Gold: "+@gold.to_s)
draw_actor_graphic(@graphic, 10, 50)
end
#-------------------------------------------------------------------------------
def update
if (self.visible != $game_switches[1]) or
(@hud_variable != $game_variables[1]) or
(@actor != $game_party.actors[@hud_variable]) or
(@class_name != @actor.class_name) or
(@hp != @actor.hp) or
(@maxhp != @actor.maxhp) or
(@sp != @actor.sp) or
(@maxsp != @actor.maxsp) or
(@exp != @actor.exp) or
(@level != @actor.level) or
(@gold != $game_party.gold)
self.visible = $game_switches[1] # This makes the HUD visible or invisible
@hud_variable = $game_variables[1] # This variable controls which party member is viewed
@actor = $game_party.actors[@hud_variable]
@name = @actor.name # Actor's name
@class_name = @actor.class_name # Actor's class
@hp = @actor.hp # Actor's current HP
@maxhp = @actor.maxhp # Actor's max HP
@sp = @actor.sp # Actor's current SP
@maxsp = @actor.maxsp # Actor's max SP
@exp = @actor.exp # Actor's current exp
@nexp = @actor.next_exp_s # The exp required for a level-up
@level = @actor.level # Actor's current level
@gold = $game_party.gold # The amount of gold currently in possession
@graphic = @actor # The actor's sprite
refresh
end
end
end
Version 1.0 DemoNo credit is needed for such a simple script, thank you.
This post has been edited by Kendorei: Jan 11 2009, 01:17 AM