even though KK20 helped me fix up the main problem i had with my HUD the fundamental problem with it was how it was designed, i choose to copy ForeverZer0's Debug output from CCTS cause it was outputting multiple displays in 1 class (i had 2 cause there was 2 different displays), anyway, i redid my Hud to use Window_Base and it's working a lot more stable now....and by that i mean it doesn't crash when i increase a stat
so anyway, my current problem is now efficiency, even on C.C who is still just a bit more powerful than a stock computer, there's a evident drop in the frame rate, anyway, here is the script
# Xgrid Class
class XGrid
# system varibales
attr_accessor :xgrid_hub
attr_accessor :xgrid
attr_accessor :hud
# inialized values
def initialize
@xgrid_hub = false
@xgrid = false
@hud = nil
end
end
class XGrid_Hud < Window_Base
HEADING_COLOR = Color.new(255, 255, 0)
SYSTEM_COLOR = Color.new(192, 224, 255)
NORMAL_COLOR = Color.new(255, 255, 255)
TOTAL_H_COLOUR = Color.new(200, 255, 200)
TOTAL_COLOUR = Color.new(100, 255, 100)
TOTAL_G_COLOUR = Color.new(40, 241, 215)
VIEWPORT_Z = 10000
def initialize
# Determine dimensions by what type of clock will be created.
dim = [275,170]
super(-2, -2, dim[0], dim[1])
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity, self.z = 255, VIEWPORT_Z
self.contents.font.name = 'Arial'
self.contents.font.size = 14
self.contents.font.bold = true
self.windowskin = RPG::Cache.windowskin('Blizz-ABS Hud')
# Draw the clock.
refresh
end
def refresh
# Clear the current bitmap.
self.contents.clear
# Set local variables equal to different text widths.
cell = [35,20]
offert_x = [contents.text_size('Aria Grids').width+10]
offset_y = [contents.text_size('XGrid Completion').height+5]
# Begin to draw the HUD.
self.contents.font.color = HEADING_COLOR
self.contents.draw_text(0, 0, 144, 15, 'XGrid Completion')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0], 144, 15, 'Aria')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0], 144, 15, 'Cain')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0], 144, 15, 'Sain')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0], 144, 15, 'Kaze')
self.contents.font.color = TOTAL_H_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0], 144, 15, 'Total')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(0, offset_y[0]+(cell[1]*1), 144, 15, 'Aria Grids')
self.contents.draw_text(0, offset_y[0]+(cell[1]*2), 144, 15, 'Cain Grids')
self.contents.draw_text(0, offset_y[0]+(cell[1]*3), 144, 15, 'Sain Grids')
self.contents.draw_text(0, offset_y[0]+(cell[1]*4), 144, 15, 'Kaze Grids')
self.contents.font.color = TOTAL_H_COLOUR
self.contents.draw_text(0, offset_y[0]+(cell[1]*5), 144, 15, 'Total %')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0]+(cell[1]*1), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0]+(cell[1]*1), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0]+(cell[1]*1), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0]+(cell[1]*1), 144, 15, '100%')
self.contents.font.color = TOTAL_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0]+(cell[1]*1), 144, 15, '100%')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0]+(cell[1]*2), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0]+(cell[1]*2), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0]+(cell[1]*2), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0]+(cell[1]*2), 144, 15, '100%')
self.contents.font.color = TOTAL_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0]+(cell[1]*2), 144, 15, '100%')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0]+(cell[1]*3), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0]+(cell[1]*3), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0]+(cell[1]*3), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0]+(cell[1]*3), 144, 15, '100%')
self.contents.font.color = TOTAL_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0]+(cell[1]*3), 144, 15, '100%')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0]+(cell[1]*4), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0]+(cell[1]*4), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0]+(cell[1]*4), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0]+(cell[1]*4), 144, 15, '100%')
self.contents.font.color = TOTAL_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0]+(cell[1]*4), 144, 15, '100%')
self.contents.font.color = TOTAL_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*0), offset_y[0]+(cell[1]*5), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*1), offset_y[0]+(cell[1]*5), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*2), offset_y[0]+(cell[1]*5), 144, 15, '100%')
self.contents.draw_text(offert_x[0]+(cell[0]*3), offset_y[0]+(cell[1]*5), 144, 15, '100%')
self.contents.font.color = TOTAL_G_COLOUR
self.contents.draw_text(offert_x[0]+(cell[0]*4), offset_y[0]+(cell[1]*5), 144, 15, '100%')
end
def update
super
# Redraw the clock every game minute.
refresh #if @mins != $game_system.time.minute
end
end
class XGrid_Char
def initialize
@elm = [XGrid_Grid_Stats.new,XGrid_Inve_Stats.new,XGrid_Char_Status.new]
end
def update
@elm[0].update
@elm[1].update
@elm[2].update
end
def dispose
@elm[0].dispose
@elm[1].dispose
@elm[2].dispose
@elm = nil
end
end
class XGrid_Grid_Stats < Window_Base
HEADING_COLOR = Color.new(255, 255, 0)
SYSTEM_COLOR = Color.new(192, 224, 255)
NORMAL_COLOR = Color.new(255, 255, 255)
TOTAL_H_COLOUR = Color.new(200, 255, 200)
TOTAL_COLOUR = Color.new(100, 255, 100)
TOTAL_G_COLOUR = Color.new(40, 241, 215)
VIEWPORT_Z = 10000
ARIA = Color.new(229, 127, 255)
SAIN = Color.new(0, 128, 255)
CAIN = Color.new(254, 0, 0)
KAZE = Color.new(0, 146, 64)
def initialize
# Determine dimensions by what type of clock will be created.
dim = [260,190]
super(-5, -7, dim[0], dim[1])
self.contents = Bitmap.new(width - 5, height - 5)
self.back_opacity, self.z = 255, VIEWPORT_Z
self.contents.font.name = 'Arial'
self.contents.font.size = 14
self.contents.font.bold = true
self.windowskin = RPG::Cache.windowskin('Blizz-ABS Hud')
# Draw the clock.
refresh
end
def refresh
# Clear the current bitmap.
self.contents.clear
# Set local variables equal to different text widths.
cell = [35,20]
slash = [contents.text_size('9999').width,0]
num = [contents.text_size('STR').width+10,contents.text_size('Limit Gates').width+10]
max = [contents.text_size('/').width+5,0]
col2 = [(num[0]+slash[0]+max[0])+30,0]
self.contents.font.color = HEADING_COLOR
# Begin to draw the HUD.
self.contents.draw_text(0, 0, 144, 15, 'Grid Stats')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(0, (cell[1]*1), 144, 15, 'Grid: '+'GRID')
self.contents.draw_text(0, (cell[1]*2), 144, 15, 'HP ')
self.contents.draw_text(0, (cell[1]*3), 144, 15, 'MP ')
self.contents.draw_text(0, (cell[1]*4), 144, 15, 'STR')
self.contents.draw_text(0, (cell[1]*5), 144, 15, 'DEX')
self.contents.draw_text(0, (cell[1]*6), 144, 15, 'AGI')
self.contents.draw_text(0, (cell[1]*7), 144, 15, 'INT')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text((num[0]), (cell[1]*2), 144, 15, '999')
self.contents.draw_text((num[0]), (cell[1]*3), 144, 15, '999')
self.contents.draw_text((num[0]), (cell[1]*4), 144, 15, '999')
self.contents.draw_text((num[0]), (cell[1]*5), 144, 15, '999')
self.contents.draw_text((num[0]), (cell[1]*6), 144, 15, '999')
self.contents.draw_text((num[0]), (cell[1]*7), 144, 15, '999')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text((num[0]+slash[0]), (cell[1]*2), 144, 15, '/')
self.contents.draw_text((num[0]+slash[0]), (cell[1]*3), 144, 15, '/')
self.contents.draw_text((num[0]+slash[0]), (cell[1]*4), 144, 15, '/')
self.contents.draw_text((num[0]+slash[0]), (cell[1]*5), 144, 15, '/')
self.contents.draw_text((num[0]+slash[0]), (cell[1]*6), 144, 15, '/')
self.contents.draw_text((num[0]+slash[0]), (cell[1]*7), 144, 15, '/')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*2), 144, 15, '999')
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*3), 144, 15, '999')
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*4), 144, 15, '999')
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*5), 144, 15, '999')
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*6), 144, 15, '999')
self.contents.draw_text((num[0]+slash[0]+max[0]), (cell[1]*7), 144, 15, '999')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(col2[0], (cell[1]*2), 144, 15, 'Limit Gates')
self.contents.draw_text(col2[0], (cell[1]*3), 144, 15, 'Level Locks')
self.contents.draw_text(col2[0], (cell[1]*4), 144, 15, 'Skill')
self.contents.draw_text(col2[0], (cell[1]*5), 144, 15, 'Nodes')
self.contents.draw_text(col2[0], (cell[1]*7), 144, 15, 'Character')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(col2[0]+(num[1]), (cell[1]*2), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]), (cell[1]*3), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]), (cell[1]*4), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]), (cell[1]*5), 144, 15, '999')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(col2[0]+(num[1]+slash[0]), (cell[1]*2), 144, 15, '/')
self.contents.draw_text(col2[0]+(num[1]+slash[0]), (cell[1]*3), 144, 15, '/')
self.contents.draw_text(col2[0]+(num[1]+slash[0]), (cell[1]*4), 144, 15, '/')
self.contents.draw_text(col2[0]+(num[1]+slash[0]), (cell[1]*5), 144, 15, '/')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(col2[0]+(num[1]+slash[0]+max[0]), (cell[1]*2), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]+slash[0]+max[0]), (cell[1]*3), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]+slash[0]+max[0]), (cell[1]*4), 144, 15, '999')
self.contents.draw_text(col2[0]+(num[1]+slash[0]+max[0]), (cell[1]*5), 144, 15, '999')
self.contents.font.color = ARIA
self.contents.draw_text(col2[0]-10+(num[1]+(15*1)), (cell[1]*7), 144, 15, 'A')
self.contents.font.color = CAIN
self.contents.draw_text(col2[0]-10+(num[1]+(15*2)), (cell[1]*7), 144, 15, 'C')
self.contents.font.color = SAIN
self.contents.draw_text(col2[0]-10+(num[1]+(15*3)), (cell[1]*7), 144, 15, 'S')
self.contents.font.color = KAZE
self.contents.draw_text(col2[0]-10+(num[1]+(15*4)), (cell[1]*7), 144, 15, 'K')
# Set instance variable. Used to check when to next refresh.
#@mins = $game_system.time.minute
end
def update
super
# Redraw the clock every game minute.
refresh #if @mins != $game_system.time.minute
end
end
class XGrid_Inve_Stats < Window_Base
HEADING_COLOR = Color.new(255, 255, 0)
SYSTEM_COLOR = Color.new(192, 224, 255)
NORMAL_COLOR = Color.new(255, 255, 255)
TOTAL_H_COLOUR = Color.new(200, 255, 200)
TOTAL_COLOUR = Color.new(100, 255, 100)
TOTAL_G_COLOUR = Color.new(40, 241, 215)
VIEWPORT_Z = 10000
ARIA = Color.new(229, 127, 255)
SAIN = Color.new(0, 128, 255)
CAIN = Color.new(254, 0, 0)
KAZE = Color.new(0, 146, 64)
def initialize
# Determine dimensions by what type of clock will be created.
dim = [160,245]
super(640-dim[0]+1, -7, dim[0], dim[1])
self.contents = Bitmap.new(width - 5, height - 5)
self.back_opacity, self.z = 255, VIEWPORT_Z
self.contents.font.name = 'Arial'
self.contents.font.size = 14
self.contents.font.bold = true
self.windowskin = RPG::Cache.windowskin('Blizz-ABS Hud')
# Draw the clock.
refresh
end
def refresh
# Clear the current bitmap.
self.contents.clear
# Set local variables equal to different text widths.
cell = [35,20]
heading = [contents.text_size('Magix').width+10,contents.text_size('Limit').width+10]
col2 = [heading[0]+contents.text_size('99').width+20,0]
section2 = [(cell[1]*6),0]
s2heading = [contents.text_size('Char Lv.').width+10,0]
self.contents.font.color = HEADING_COLOR
# Begin to draw the HUD.
self.contents.draw_text(0, 0, 144, 15, 'System Stats')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(0, (cell[1]*1), 144, 15, 'Sphere Stock:')
self.contents.draw_text(0, (cell[1]*2), 144, 15, 'Power')
self.contents.draw_text(0, (cell[1]*3), 144, 15, 'Mind')
self.contents.draw_text(0, (cell[1]*4), 144, 15, 'Speed')
self.contents.draw_text(0, (cell[1]*5), 144, 15, 'Magix')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(heading[0], (cell[1]*2), 144, 15, '99')
self.contents.draw_text(heading[0], (cell[1]*3), 144, 15, '99')
self.contents.draw_text(heading[0], (cell[1]*4), 144, 15, '99')
self.contents.draw_text(heading[0], (cell[1]*5), 144, 15, '99')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(col2[0], (cell[1]*2), 144, 15, 'Tetra')
self.contents.draw_text(col2[0], (cell[1]*3), 144, 15, 'Char')
self.contents.draw_text(col2[0], (cell[1]*4), 144, 15, 'Limit')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(col2[0]+heading[1], (cell[1]*2), 144, 15, '99')
self.contents.draw_text(col2[0]+heading[1], (cell[1]*3), 144, 15, '99')
self.contents.draw_text(col2[0]+heading[1], (cell[1]*4), 144, 15, '99')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(0, section2[0]+(cell[1]*1), 144, 15, 'Misc:')
self.contents.draw_text(0, section2[0]+(cell[1]*2), 144, 15, 'Stage')
self.contents.draw_text(0, section2[0]+(cell[1]*3), 144, 15, 'Char Lv.')
self.contents.draw_text(0, section2[0]+(cell[1]*4), 144, 15, 'GP')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(s2heading[0], section2[0]+(cell[1]*2), 144, 15, '99')
self.contents.draw_text(s2heading[0], section2[0]+(cell[1]*3), 144, 15, '99')
self.contents.draw_text(s2heading[0], section2[0]+(cell[1]*4), 144, 15, '999999999999')
# Set instance variable. Used to check when to next refresh.
#@mins = $game_system.time.minute
end
def update
super
# Redraw the clock every game minute.
refresh #if @mins != $game_system.time.minute
end
end
class XGrid_Char_Status < Window_Base
HEADING_COLOR = Color.new(255, 255, 0)
SYSTEM_COLOR = Color.new(192, 224, 255)
NORMAL_COLOR = Color.new(255, 255, 255)
TOTAL_H_COLOUR = Color.new(200, 255, 200)
TOTAL_COLOUR = Color.new(100, 255, 100)
TOTAL_G_COLOUR = Color.new(40, 241, 215)
UNEQUIPED = Color.new(175, 175, 175)
VIEWPORT_Z = 10000
EXION = [Color.new(229, 127, 255),Color.new(0, 128, 255),
Color.new(254, 0, 0),Color.new(0, 146, 64)]
def initialize
# Determine dimensions by what type of clock will be created.
dim = [255,170]
super(160, 240, dim[0], dim[1])
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity, self.z = 255, VIEWPORT_Z
self.contents.font.name = 'Arial'
self.contents.font.size = 14
self.contents.font.bold = true
self.windowskin = RPG::Cache.windowskin('Blizz-ABS Hud')
# Draw the clock.
refresh
end
def refresh
# Clear the current bitmap.
self.contents.clear
# Set local variables equal to different text widths.
cell = [35,20]
heading = [contents.text_size('STR').width+10,contents.text_size('999999').width+10]
value = [contents.text_size('999999').width+10,0]
self.contents.font.color = HEADING_COLOR
# Begin to draw the HUD.
self.contents.draw_text(0, (cell[1]*0), 144, 15, $game_actors[1].name+' Stats')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(((heading[0]+value[0])*0), (cell[1]*1), 144, 15, 'HP')
self.contents.draw_text(((heading[0]+value[0])*1), (cell[1]*1), 144, 15, 'MP')
self.contents.draw_text(((heading[0]+value[0])*2), (cell[1]*1), 144, 15, 'STR')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(((heading[0]+value[0])*0)+heading[0], (cell[1]*1), 144, 15, '999999')
self.contents.draw_text(((heading[0]+value[0])*1)+heading[0], (cell[1]*1), 144, 15, '999999')
self.contents.draw_text(((heading[0]+value[0])*2)+heading[0], (cell[1]*1), 144, 15, $game_actors[1].str.to_s)
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(((heading[0]+value[0])*0), (cell[1]*2), 144, 15, 'DEX')
self.contents.draw_text(((heading[0]+value[0])*1), (cell[1]*2), 144, 15, 'AGI')
self.contents.draw_text(((heading[0]+value[0])*2), (cell[1]*2), 144, 15, 'INT')
self.contents.font.color = NORMAL_COLOR
self.contents.draw_text(((heading[0]+value[0])*0)+heading[0], (cell[1]*2), 144, 15, '999999')
self.contents.draw_text(((heading[0]+value[0])*1)+heading[0], (cell[1]*2), 144, 15, '999999')
self.contents.draw_text(((heading[0]+value[0])*2)+heading[0], (cell[1]*2), 144, 15, '999999')
self.contents.font.color = SYSTEM_COLOR
self.contents.draw_text(0, (cell[1]*3), 144, 15, 'Exion')
self.contents.font.color = UNEQUIPED
self.contents.draw_text((heading[1]*0), (cell[1]*4), 144, 15, 'Fivian') # Fire
self.contents.draw_text((heading[1]*1), (cell[1]*4), 144, 15, 'Ita') # Ice
self.contents.draw_text((heading[1]*2), (cell[1]*4), 144, 15, 'Ikado') # Thunder
self.contents.draw_text((heading[1]*3), (cell[1]*4), 144, 15, 'Uti') # Water
self.contents.draw_text((heading[1]*4), (cell[1]*4), 144, 15, 'Marcos') # Earth
self.contents.draw_text((heading[1]*0), (cell[1]*5), 144, 15, 'Ace') # Wind
self.contents.draw_text((heading[1]*1), (cell[1]*5), 144, 15, 'Theti') # Light
self.contents.draw_text((heading[1]*2), (cell[1]*5), 144, 15, 'Moe') # Darkness
self.contents.draw_text((heading[1]*3), (cell[1]*5), 144, 15, 'Seraph') # Mind
self.contents.draw_text((heading[1]*4), (cell[1]*5), 144, 15, 'Roxas') # Ballance
self.contents.draw_text((heading[1]*2), (cell[1]*6), 144, 15, 'Mema') # Secret
end
def update
super
# Redraw the clock every game minute.
refresh #if @mins != $game_system.time.minute
end
end
class Scene_Map
alias xgrid_main main
def main
# Main loop.
xgrid_main
end
alias xgrid_upd update
def update
xgrid_upd
if $xgrid.hud == nil
if $xgrid.xgrid == true
$xgrid.hud = XGrid_Char.new
end
if $xgrid.xgrid_hub == true
$xgrid.hud = XGrid_Hud.new
end
end
if $xgrid.hud != nil
if $xgrid.xgrid == true || $xgrid.xgrid_hub == true
$xgrid.hud.update
else
$xgrid.hud = $xgrid.hud.dispose
end
end
end
end
here are the 4 events you will need, each event has a single call script with the code specified
Event 1 need to be triggered first, it will display the hub HUD, the second event deactivates the HUD and need to be run whenever you switch between them, the 3rd and 4th events activate the named HUDs (Hub and Grid)
i'm wondering where in my HUD Classes it needs improvement to make it more efficient, the main problem is what i want fixed up more than anything cause the first one only happens on Aura and she's getting old (she can't run Vista, only XP)
NOTE: any of the white Text, the 4 colored letters in the top left window, the word "GRID" next to "grid:" and the Exion List in the bottom window are dynamic, i'm just using static values at the moment, also, the bottom window doesn't have a place yet, still thinking on where i should put it