HUD Request

Hi there!

Whether or not this'll be easy is completely unknown to me, and I've tried tinkering myself but have had no results.

I'm using Khas' Sapphire Action System [ABS] and the HUD that comes along with it, but I need my own one that's relatively minimal compared to the script's default.

What I'm looking for is one that resembles this -

Spoiler
Dark-Souls_2011_09-30-11_013.jpg
What I don't need from that is all the equipment information at the bottom left.

I would like the red bar to represent the character's HP, and the green bar for MP. I'd also like a third bar underneath the green one with a blue colour to represent the value of a variable of my choosing. As for the circle with the number in it, that too would represent the value of a variable.

And, you guessed it, the bottom right box would also contain a variable.

I'm pretty sure this is the case anyway but I'd need to have this update automatically because I'm using an ABS. If it helps, here's the script for the HUD I'm already using.

Spoiler
Code:
#-------------------------------------------------------------------------------
# * [ACE] SAS IV HUD
#-------------------------------------------------------------------------------
# * By Khas Arcthunder - arcthunder.site40.net
# * Version: 4.1 EN
# * Released on: 13/02/2012
#
#-------------------------------------------------------------------------------
# * Terms of Use
#-------------------------------------------------------------------------------
# When using any Khas script, you agree with the following terms:
# 1. You must give credit to Khas;
# 2. All Khas scripts are licensed under a Creative Commons license;
# 3. All Khas scripts are for non-commercial projects. If you need some script
# for your commercial project (I accept requests for this type of project),
# send an email to [email hidden] with your request;
# 4. All Khas scripts are for personal use, you can use or edit for your own
# project, but you are not allowed to post any modified version;
# 5. You can’t give credit to yourself for posting any Khas script;
# 6. If you want to share a Khas script, don’t post the script or the direct
# download link, please redirect the user to arcthunder.site40.net
# 7. You are not allowed to convert any of Khas scripts to another engine,
# such converting a RGSS3 script to RGSS2 or something of that nature.
#
# Check all the terms at http://arcthunder.site40.net/terms/
#
#-------------------------------------------------------------------------------
# * Features
#-------------------------------------------------------------------------------
# Optimized SAS IV HUD.
#
#-------------------------------------------------------------------------------
# * Configuration
#-------------------------------------------------------------------------------
module HUD_Core
Background_Name = "hud_bg"
Contents_Width = 544
Contents_Height = 80
Font_Size = 16
Font_Name = "Verdana"
Font_Color = Color.new(255,255,255)
Font_Bold = true
Font_Italic = false
No_Skill_Icon = 117
Health_X = 73
Health_Y = 40
Health_Width = 100
Health_Height = 4
Health_Color = Color.new(100,255,0)
Exp_X = 72
Exp_Y = 50
Exp_Width = 68
Exp_Height = 4
Exp_Color = Color.new(0,255,255)
Magic_X = 442
Magic_Y = 40
Magic_Width = 68
Magic_Height = 4
Magic_Color = Color.new(255,255,0)
Name_X = 76
Name_Y = 20
Spell_X = 444
Spell_Y = 20
Icon_X = 498
Icon_Y = 28
Level_X = 10
Level_Y = 60
Level_String = "Lv "
end
#-------------------------------------------------------------------------------
# * Register
#-------------------------------------------------------------------------------
if $khas_awesome.nil?
$khas_awesome = []
end
scripts = []
$khas_awesome.each { |script| scripts << script[0] }
unless scripts.include?("Sapphire Action System")
error = Sprite.new
error.bitmap = Bitmap.new(544,416)
error.bitmap.draw_text(0,208,544,32,"Please install the Sapphire Action System IV",1)
continue = Sprite.new
continue.bitmap = Bitmap.new(544,416)
continue.bitmap.font.color = Color.new(0,255,0)
continue.bitmap.font.size = error.bitmap.font.size - 3
continue.bitmap.draw_text(0,384,544,32,"Tecle ENTER para sair",1)
add = Math::PI/80; max = 2*Math::PI; angle = 0
loop do
Graphics.update; Input.update
angle += add; angle %= max
continue.opacity = 185 + 70* Math.cos(angle)
break if Input.trigger?(Input::C)
end
error.bitmap.dispose; continue.bitmap.dispose
error.bitmap = nil; continue.bitmap = nil
error.dispose; continue.dispose
error = nil; continue = nil
exit
end

$khas_awesome << ["SAS HUD",4.0]

#-------------------------------------------------------------------------------
# * Script
#-------------------------------------------------------------------------------

class Sapphire_Hud
include HUD_Core
def initialize
@contents = Sprite.new
@background = Sprite.new
@base = Sprite.new
@contents.bitmap = Bitmap.new(Contents_Width, Contents_Height)
@base.bitmap = Bitmap.new(Contents_Width, Contents_Height)
@background.bitmap = Cache.system(Background_Name)
@base.bitmap.font.bold = Font_Bold
@base.bitmap.font.italic = Font_Italic
@base.bitmap.font.size = Font_Size
@base.bitmap.font.color = Font_Color
@base.bitmap.font.name = Font_Name
@contents.z = 200
@background.z = 210
@base.z = 220
@locked = false
hide(true)
end
def refresh_bars([email protected])
return if @hidden
hp = ((current_hp)*Health_Width)/@actor.mhp
mp = (@actor.mp*Magic_Width)/@actor.mmp
exp = ((@[email hidden]_level_exp)*Exp_Width)/(@[email hidden]_level_exp)
@contents.bitmap.clear
@contents.bitmap.fill_rect(Health_X,Health_Y,hp,Health_Height,Health_Color)
@contents.bitmap.fill_rect(Magic_X+Magic_Width-mp,Magic_Y,mp,Magic_Height,Magic_Color)
@contents.bitmap.fill_rect(Exp_X,Exp_Y,exp,Exp_Height,Exp_Color)
end
def refresh_base
return if @hidden
@base.bitmap.clear
@actor = $game_party.members[0]
skill = $game_player.current_skill[0]
@base.bitmap.draw_text(Name_X, Name_Y,100,Font_Size+4,@actor.name)
@base.bitmap.draw_text(Level_X, Level_Y,64,Font_Size+4,[email hidden]_s,1)
temp = Cache.system("Iconset")
unless skill.nil?
@base.bitmap.draw_text(Spell_X,Spell_Y,68,Font_Size+4,skill.name)
@base.bitmap.blt(Icon_X,Icon_Y,temp,Rect.new(skill.icon_index%16*24,skill.icon_index/16*24,24,24))
else
@base.bitmap.blt(Icon_X,Icon_Y,temp,Rect.new(No_Skill_Icon%16*24,No_Skill_Icon/16*24,24,24))
end
temp.dispose
temp = nil
end
def hide(lock=false)
unless @background.nil?
@background.bitmap.dispose
@background.dispose
@background = nil
end
unless @base.nil?
@base.bitmap.dispose
@base.dispose
@base = nil
end
unless @contents.nil?
@contents.bitmap.dispose
@contents.dispose
@contents = nil
end
@hidden = true
@locked = lock unless @locked
end
def show(unlock=false)
@actor = $game_party.members[0]
return if @locked && !unlock
@contents = Sprite.new
@background = Sprite.new
@base = Sprite.new
@contents.bitmap = Bitmap.new(Contents_Width, Contents_Height)
@base.bitmap = Bitmap.new(Contents_Width, Contents_Height)
@background.bitmap = Cache.system(Background_Name)
@base.bitmap.font.bold = Font_Bold
@base.bitmap.font.italic = Font_Italic
@base.bitmap.font.size = Font_Size
@base.bitmap.font.color = Font_Color
@base.bitmap.font.name = Font_Name
@contents.z = 200
@background.z = 210
@base.z = 220
@hidden = false
refresh_base
refresh_bars
@locked = false
end
end
I'd like to keep the magic display options from that script too.

If I need graphics then give me a shout. Otherwise, the numbers in the circle can just be system drawn alongside the ones in the box at the bottom right.
bumpers
Copy these two scripts, they are two HUDs that I combined for Khas's ABS. Not sure if they will work for your project, but give it a try.

Spoiler
#===== Rpg Makver VX ACE Script =============================#= Simple Hud

#===== By: ==================================================

#= lilcooldude69

#===== Current Version: =====================================

#= 1.0

#===== Compatible With: =====================================

#= Rpg Maker VX ACE

#===== Description: =========================================

#= Sells items useful for 2-2 Classes

#===== Additional Comments: =================================

#=

#============================================================

module Hud_config

#Configuration

SWITCH = 5 #the number of the switched used to make it visible Example: if this is 1 then Switch 001 will turn on the hud.

EXPTERM = "Exp" #Term used for The Exp Bar

GOLD = "G" #Term used for the Gold, You may have to make adjustments below if > 1 character

OPACITY = 70 #used for the opacity of the window, Mess with this to your liking 😛

#end config

end

#=====DO NOT EDIT PAST HERE UNLESS YOU KNOW WHAT YOUR DOING======#

#=================EXCLUDING WHAT WAS SAID ABOVE==================#

include Hud_config

class Window_Hud < Window_Base

#----------------------------------------------------

# * Object Initialization

#----------------------------------------------------

def initialize

super(0,0, 125,90)

create_contents

self.visible = $game_switches[sWITCH]

@actor = $game_party.members[0]

refresh

end

def exp_gauge_color1; text_color(31); end;

def exp_gauge_color2; text_color(27); end;

#----------------------------------------------------

# * Refresh

#----------------------------------------------------

def refresh

self.contents.clear

contents.clear

draw_window_content

end

#----------------------------------------------------

# * Draw Window Contents * Drawing of all the contents gold, hp bar, etc

#----------------------------------------------------

def draw_window_content

@gold = $game_party.gold

@level = @actor.level

@hp = @actor.hp

@mp = @actor.mp

@tp = @actor.tp

@exp = @actor.exp

contents.font.size = 18

draw_actor_level(@actor, 0, 0)

draw_actor_hp(@actor, 0, 17, 102)

draw_actor_mp(@actor, 0, 37, 102)

#==========Make the Adjustment here if you edited the GOLD variable to be longer than 1 Character===============

contents.font.size = Font.default_size

#draw_currency_value(Gold Variable, Term Variable, X-pos, Y-Pos, Width) change the width if you make the term longer than 1 char

#example, draw_currency_value(@gold, GOLD, 0, 155, 110)

#==========Make the Adjustment here if you edited the GOLD variable to be longer than 1 Character===============

end

#-----------------------------------------------------

# * Update * used to keep things up to date

#-----------------------------------------------------

def update

super

self.visible = $game_switches[sWITCH]

return if !self.visible

if @level != @actor.level or @hp != @actor.hp or @mp != @actor.mp or

@tp != @actor.tp or @exp != @actor.exp or @gold != $game_party.gold

refresh

end

end

#-----------------------------------------------------

# * Custom Definition for the experience bar free to use if you like

#-----------------------------------------------------

def draw_exp(actor, x, y, width = 124)

s1 = @actor.max_level? ? "---------" : @actor.exp

s2 = @actor.max_level? ? "---------" : @actor.next_level_exp - @actor.exp

if @actor.max_level? ? draw_gauge(x, y, width, 1, exp_gauge_color1, exp_gauge_color2)

:

draw_gauge(x, y, width,(((actor.exp.to_f/100) / (actor.next_level_exp.to_f/100)) * 100),

exp_gauge_color1, exp_gauge_color2)

end

change_color(system_color)

draw_text(x, y, 30, line_height, EXPTERM)

change_color(text_color(27))

if @actor.max_level? ? draw_text(x + width - 72, y, 72, line_height, "------------", 2)

:

draw_text(x + width - 72, y, 72, line_height, actor.next_level_exp.to_i - actor.exp.to_i, 2)

end

end

end

#------------------------------------------------------

# * Scene_Map Class, For keeping it on the map

#------------------------------------------------------

class Scene_Map < Scene_Base

alias start_window start

alias term_window terminate

alias update_window update

def start

start_window

@winhud = Window_Hud.new

update

end

def terminate

@winhud.dispose

term_window

end

def update

update_window

@winhud.update

end

end
Spoiler
#-------------------------------------------------------------------------------# * [ACE] SAS IV HUD

#-------------------------------------------------------------------------------

# * By Khas Arcthunder - arcthunder.site40.net

# * Version: 4.1 EN

# * Released on: 13/02/2012

#

#-------------------------------------------------------------------------------

# * Terms of Use

#-------------------------------------------------------------------------------

# When using any Khas script, you agree with the following terms:

# 1. You must give credit to Khas;

# 2. All Khas scripts are licensed under a Creative Commons license;

# 3. All Khas scripts are for non-commercial projects. If you need some script

# for your commercial project (I accept requests for this type of project),

# send an email to [email hidden] with your request;

# 4. All Khas scripts are for personal use, you can use or edit for your own

# project, but you are not allowed to post any modified version;

# 5. You can’t give credit to yourself for posting any Khas script;

# 6. If you want to share a Khas script, don’t post the script or the direct

# download link, please redirect the user to arcthunder.site40.net

# 7. You are not allowed to convert any of Khas scripts to another engine,

# such converting a RGSS3 script to RGSS2 or something of that nature.

#

# Check all the terms at http://arcthunder.site40.net/terms/

#

#-------------------------------------------------------------------------------

# * Features

#-------------------------------------------------------------------------------

# Optimized SAS IV HUD.

#

#-------------------------------------------------------------------------------

# * Configuration

#-------------------------------------------------------------------------------

module HUD_Core

Background_Name = ""

Contents_Width = 544

Contents_Height = 80

Font_Size = 16

Font_Name = "Verdana"

Font_Color = Color.new(255,255,255)

Font_Bold = true

Font_Italic = false

No_Skill_Icon = 117

Health_X = 73

Health_Y = 40

Health_Width = 100

Health_Height = 4

Health_Color = Color.new(100,255,0)

Exp_X = 72

Exp_Y = 50

Exp_Width = 68

Exp_Height = 4

Exp_Color = Color.new(0,255,255)

Magic_X = 442

Magic_Y = 40

Magic_Width = 68

Magic_Height = 4

Magic_Color = Color.new(255,255,0)

Name_X = 76

Name_Y = 20

Spell_X = 444

Spell_Y = 20

Icon_X = 85

Icon_Y = 8

Level_X = 10

Level_Y = 60

Level_String = "Lv "

end

#-------------------------------------------------------------------------------

# * Register

#-------------------------------------------------------------------------------

if $khas_awesome.nil?

$khas_awesome = []

end

scripts = []

$khas_awesome.each { |script| scripts << script[0] }

unless scripts.include?("Sapphire Action System")

error = Sprite.new

error.bitmap = Bitmap.new(544,416)

error.bitmap.draw_text(0,208,544,32,"Please install the Sapphire Action System IV",1)

continue = Sprite.new

continue.bitmap = Bitmap.new(544,416)

continue.bitmap.font.color = Color.new(0,255,0)

continue.bitmap.font.size = error.bitmap.font.size - 3

continue.bitmap.draw_text(0,384,544,32,"Tecle ENTER para sair",1)

add = Math:😛I/80; max = 2*Math:😛I; angle = 0

loop do

Graphics.update; Input.update

angle += add; angle %= max

continue.opacity = 185 + 70* Math.cos(angle)

break if Input.trigger?(Input::C)

end

error.bitmap.dispose; continue.bitmap.dispose

error.bitmap = nil; continue.bitmap = nil

error.dispose; continue.dispose

error = nil; continue = nil

exit

end

$khas_awesome << ["SAS HUD",4.0]

#-------------------------------------------------------------------------------

# * Script

#-------------------------------------------------------------------------------

class Sapphire_Hud

include HUD_Core

def initialize

@contents = Sprite.new

@background = Sprite.new

@base = Sprite.new

@contents.bitmap = Bitmap.new(Contents_Width, Contents_Height)

@base.bitmap = Bitmap.new(Contents_Width, Contents_Height)

@background.bitmap = Cache.system(Background_Name)

@base.bitmap.font.bold = Font_Bold

@base.bitmap.font.italic = Font_Italic

@base.bitmap.font.size = Font_Size

@base.bitmap.font.color = Font_Color

@base.bitmap.font.name = Font_Name

@contents.z = 200

@background.z = 210

@base.z = 220

@locked = false

hide(true)

end

def refresh_base

return if @hidden

@base.bitmap.clear

skill = $game_player.current_skill[0]

temp = Cache.system("Iconset")

unless skill.nil?

@base.bitmap.blt(Icon_X,Icon_Y,temp,Rect.new(skill.icon_index%16*24,skill.icon_index/16*24,24,24))

else

@base.bitmap.blt(Icon_X,Icon_Y,temp,Rect.new(No_Skill_Icon%16*24,No_Skill_Icon/16*24,24,24))

end

temp.dispose

temp = nil

end

def hide(lock=false)

unless @background.nil?

@background.bitmap.dispose

@background.dispose

@background = nil

end

unless @base.nil?

@base.bitmap.dispose

@base.dispose

@base = nil

end

unless @contents.nil?

@contents.bitmap.dispose

@contents.dispose

@contents = nil

end

@hidden = true

@locked = lock unless @locked

end

def show(unlock=false)

@actor = $game_party.members[0]

return if @locked && !unlock

@contents = Sprite.new

@background = Sprite.new

@base = Sprite.new

@contents.bitmap = Bitmap.new(Contents_Width, Contents_Height)

@base.bitmap = Bitmap.new(Contents_Width, Contents_Height)

@background.bitmap = Cache.system(Background_Name)

@base.bitmap.font.bold = Font_Bold

@base.bitmap.font.italic = Font_Italic

@base.bitmap.font.size = Font_Size

@base.bitmap.font.color = Font_Color

@base.bitmap.font.name = Font_Name

@contents.z = 200

@background.z = 210

@base.z = 220

@hidden = false

refresh_base

refresh_bars

@locked = false

end

end
Thanks mate, but that didn't work for me. Cheers all the same though!

Original thread: https://forums.rpgmakerweb.com/threads/hud-request.2997/