This is a special script request station for HUDs(Heads Up Display). For a short time, I will script HUDs requested one at a time.
No more requests will be accepted from now on.
Current Requests:
MistTribe(Post #23) - Standby(Too vague)
zealex(Post #28) - Standby(Waiting for MistTribe's HUD)
Completed HUDs:
Code:
#==============================================================================
# ** HUD for Sasame_Kiryu
# * Made by MeisMe
# September 2006
#==============================================================================
class Window_MapActor < Window_Base
def initialize
super(-16, 272, 672, 224)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents_opacity = $game_player.screen_y >= 292 ? 90 : 255
@wait_count = Graphics.frame_rate * 3
refresh
end
def refresh
self.contents.clear
for i in 0...8
x = (i % 4) * 160
y = (i / 4) * 96
bitmap = RPG::Cache.picture('HUD Window')
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 160, 96))
x += 4
actor = $game_party.actors[i]
if actor
draw_actor_graphic(actor, x + 12, y + 92)
draw_actor_state(actor, x, y, 156)
draw_actor_hp(actor, x, y + 32, 156)
draw_actor_sp(actor, x, y + 64, 156)
else
self.contents.draw_text(x, y + 32, 160, 32, 'No data', 1)
end
end
end
def update
super
if @wait_count == 0
self.contents_opacity -= 16 if self.contents_opacity > 0
else
@wait_count -= 1
if $game_player.screen_y >= 292
self.contents_opacity -= 15 if self.contents_opacity > 90
else
self.contents_opacity += 15 if self.contents_opacity < 255
end
end
end
end
class Scene_Map
alias old_main main
alias old_update update
def main
@mapactor_window = Window_MapActor.new
old_main
@mapactor_window.dispose
end
def update
@mapactor_window.update
old_update
end
end
Required picture:
http://i12.photobucket.com/albums/a229/ ... Holder.png[/IMG]
http://i12.photobucket.com/albums/a229/ ... Holder.png[/IMG]
Code:
#==============================================================================
# ** HUD for Immortal
# * Made by MeisMe
# September 2006
#==============================================================================
#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("ABS HUD", "MeisMe", 1, "Septemver 2006")
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if (SDK.state("ABS") == true && SDK.state("ABS HUD") == true)
class Game_Actor
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @level != $data_actors[@actor_id].final_level ? @exp -
@exp_list[@level] : 1
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] -
@exp_list[@level] : 1
end
end
class Window_HUD < Window_Base
def initialize
super(-16, -16, 672, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents_opacity = $game_player.screen_y <= 112 ? 90 : 255
self.contents.font.size = 14
refresh
end
def refresh
reset_variables
self.contents.clear
return if !@actor
draw_actor_graphic(@actor, 16, 64)
draw_actor_hpbar(@actor, 32, 0, 100, 6)
draw_actor_spbar(@actor, 32, 24, 100, 6)
draw_actor_expbar(@actor, 32, 48, 100, 6)
bitmap = RPG::Cache.picture('Skill Holder')
self.contents.blt(320, 0, bitmap, Rect.new(0, 0, 320, 32))
for i in 0...$ABS.skills.size
next if !$ABS.skills[i]
if i == 0
x = 608
else
x = (i - 1) * 32 + 320
end
y = 0
skill = $data_skills[$ABS.skills[i]]
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x + 5, y + 5, bitmap, Rect.new(0, 0, 24, 24))
end
end
def reset_variables
@actor = $game_party.actors[0]
@skills = $ABS.skills
@old_hp = @actor ? @actor.hp : 0
@old_mhp = @actor ? @actor.maxhp : 0
@old_sp = @actor ? @actor.sp : 0
@old_msp = @actor ? @actor.maxsp : 0
@old_exp = @actor ? @actor.now_exp : 0
@old_nextexp = @actor ? @actor.next_exp : 0
end
def draw_actor_hpbar(actor, x, y, length, height)
percent = actor.hp * length / actor.maxhp
self.contents.fill_rect(x, y + 14, length + 2, height + 2,
Color.new(255, 246, 229))
self.contents.fill_rect(x + 1, y + 15, length, height,
Color.new(0, 0, 0))
self.contents.fill_rect(x + 1, y + 15, percent, height,
Color.new(200, 0, 0))
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 16, $data_system.words.hp)
self.contents.font.color = normal_color
text = "#{actor.hp}/#{actor.maxhp}"
self.contents.draw_text(x, y, length + 2, 16, text, 2)
end
def draw_actor_spbar(actor, x, y, length, height)
percent = actor.sp * length / actor.maxsp
self.contents.fill_rect(x, y + 14, length + 2, height + 2,
Color.new(255, 246, 229))
self.contents.fill_rect(x + 1, y + 15, length, height,
Color.new(0, 0, 0))
self.contents.fill_rect(x + 1, y + 15, percent, height,
Color.new(0, 0, 200))
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 16, $data_system.words.sp)
self.contents.font.color = normal_color
text = "#{actor.sp}/#{actor.maxsp}"
self.contents.draw_text(x, y, length + 2, 16, text, 2)
end
def draw_actor_expbar(actor, x, y, length, height)
percent = actor.now_exp * length / actor.next_exp
self.contents.fill_rect(x, y + 14, length + 2, height + 2,
Color.new(255, 246, 229))
self.contents.fill_rect(x + 1, y + 15, length, height,
Color.new(0, 0, 0))
self.contents.fill_rect(x + 1, y + 15, percent, height,
Color.new(0, 200, 0))
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 16, 'EXP')
self.contents.font.color = normal_color
text = "#{actor.now_exp}/#{actor.next_exp}"
self.contents.draw_text(x, y, length + 2, 16, text, 2)
end
def update
super
refresh if state_change?
if $game_player.screen_y <= 112
self.contents_opacity -= 15 if self.contents_opacity > 90
else
self.contents_opacity += 15 if self.contents_opacity < 255
end
end
def state_change?
if (@actor != $game_party.actors[0] or
@skills != $ABS.skills or
@old_hp != @actor ? @actor.hp : 0 or
@old_mhp != @actor ? @actor.maxhp : 0 or
@old_sp != @actor ? @actor.sp : 0 or
@old_msp != @actor ? @actor.maxsp : 0 or
@old_exp != @actor ? @actor.now_exp : 0 or
@old_nextexp = @actor ? @actor.next_exp : 0)
return true
end
return false
end
end
class Scene_Map
alias hud_main_draw main_draw
def main_draw
@HUD = Window_HUD.new
hud_main_draw
end
alias hud_update_graphics update_graphics
def update_graphics
@HUD.update
hud_update_graphics
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Required Picture:
http://i12.photobucket.com/albums/a229/ ... eonHUD.png[/img]
http://i12.photobucket.com/albums/a229/ ... eonHUD.png[/img]
Code:
#==============================================================================
# ** HUD for Deon204
# * Scripted by MeisMe
# September 2006
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @level != $data_actors[@actor_id].final_level ? @exp -
@exp_list[@level] : 1
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] -
@exp_list[@level] : 1
end
end
class Window_HUDMain < Window_Base
def initialize
super(-16, 358, 672, 138)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.size = 16
if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
self.contents_opacity = 90
end
refresh
end
def refresh
reset_variables
self.contents.clear
background = RPG::Cache.picture('DeonHUD')
self.contents.blt(0, 0, background, Rect.new(0, 0, 640, 106))
if @actor
bitmap = RPG::Cache.hudface(@actor.name)
self.contents.blt(17, 15, bitmap, Rect.new(0, 0, 61, 74))
draw_actor_hpbar(@actor, 85, 32, 75, 9)
draw_actor_spbar(@actor, 85, 74, 75, 9)
self.contents.draw_text(81, 5, 21, 27, $data_system.words.hp)
text = "#{@actor.hp}/#{@actor.maxhp}"
self.contents.draw_text(100, 5, 60, 27, text, 2)
self.contents.draw_text(81, 47, 21, 27, $data_system.words.sp)
text = "#{@actor.sp}/#{@actor.maxsp}"
self.contents.draw_text(100, 47, 60, 27, text, 2)
self.contents.draw_text(176, 15, 40, 27, 'Time:')
self.contents.draw_text(176, 67, 40, 27, 'Status:')
self.contents.draw_text(494, 39, 40, 27, $data_system.words.gold + ':')
self.contents.draw_text(494, 39, 138, 27, @gold.to_s, 2)
self.contents.draw_text(494, 77, 40, 24, 'EXP:')
text = "#{@actor.now_exp}/#{@actor.next_exp}"
self.contents.draw_text(494, 77, 138, 24, text, 2)
end
end
def reset_variables
@actor = $game_party.actors[0]
@gold = $game_party.gold
@hp = @actor ? @actor.hp : 0
@mhp = @actor ? @actor.maxhp : 0
@sp = @actor ? @actor.sp : 0
@msp = @actor ? @actor.maxsp : 0
@nowexp = @actor ? @actor.now_exp : 0
@nextexp = @actor ? @actor.next_exp : 0
end
def draw_actor_hpbar(actor, x, y, width, height)
percent = actor.hp * (width - 4) / actor.maxhp
self.contents.fill_rect(x, y, width, height, Color.new(0, 0, 0))
self.contents.fill_rect(x + 2, y + 2, percent, height - 4,
Color.new(255, 0, 0))
end
def draw_actor_spbar(actor, x, y, width, height)
percent = actor.sp * (width - 4) / actor.maxsp
self.contents.fill_rect(x, y, width, height, Color.new(0, 0, 0))
self.contents.fill_rect(x + 2, y + 2, percent, height - 4,
Color.new(0, 0, 255))
end
def update
super
if (@actor != $game_party.actors[0] or
@gold != $game_party.gold or
@hp != @actor ? @actor.hp : 0 or
@mhp != @actor ? @actor.maxhp : 0 or
@sp != @actor ? @actor.sp : 0 or
@msp != @actor ? @actor.maxsp : 0 or
@nowexp != @actor ? @actor.now_exp : 0 or
@nextexp != @actor ? @actor.next_exp : 0)
refresh
end
if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
self.contents_opacity -= 15 if self.contents_opacity > 90
else
self.contents_opacity += 15 if self.contents_opacity < 255
end
end
end
class Window_HUDTS < Window_Base
def initialize
super(-16, 358, 672, 138)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.size = 16
@blink = 0
if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
self.contents_opacity = 90
end
refresh
end
def refresh
reset_variables
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(176, 15, 96, 27, @time, 2)
self.contents.font.color = status_color
text = @state ? $data_states[@state].name : 'Normal'
self.contents.draw_text(176, 67, 96, 27, text, 2)
end
def reset_variables
@actor = $game_party.actors[0]
@time = $ats.clock
@state = @actor ? @actor.states[0] : ''
end
def status_color
case @state
when 1
return Color.new(255, 0, 0)
when 2
return Color.new(255, 0, 255)
when 3
return Color.new(160, 160, 160)
when 4
if @blink > 5
return Color.new(255, 255, 255)
else
return Color.new(160, 160, 160)
end
when 5
return Color.new(255, 255, 0)
when 6
return Color.new(160, 0, 0)
end
return Color.new(0, 255, 0)
end
def update
super
if (@actor != $game_party.actors[0] or
@time != $ats.clock or
@state != @actor ? @actor.states[@actor.states.size - 1] : '')
refresh
end
if @state == 4
@blink = (@blink + 1) % 10
refresh if @blink == 0 or @blink == 5
else
@blink = 0
end
if (($game_player.screen_y >= 368 && $game_player.screen_x <= 288) ||
($game_player.screen_y >= 400 && $game_player.screen_x >= 480))
self.contents_opacity -= 15 if self.contents_opacity > 90
else
self.contents_opacity += 15 if self.contents_opacity < 255
end
end
end
class Scene_Map
alias hud_main main
alias hud_update update
def main
@HUD = Window_HUDMain.new
@HUD2 = Window_HUDTS.new
hud_main
@HUD.dispose
@HUD2.dispose
end
def update
@HUD.update
@HUD2.update
hud_update
end
end
module RPG
module Cache
def self.hudface(filename)
self.load_bitmap("Graphics/Characters/Hudface/", filename)
end
end
end
Sent by PM on a special request. HUD will be availiable from his Zombie Starter Pack
Code:
#==============================================================================
# ** HUD for Zavoria
# * Scripted by MeisMe
# September 2006
#==============================================================================
class Game_Player
attr_reader :sanity
def initialize
super
@sanity = 100
@frame_count = 0
end
def increase_steps
super
# If move route is not forcing
unless @move_route_forcing
# Increase steps
$game_party.increase_steps
# Number of steps are an even number
if $game_party.steps % 2 == 0
# Slip damage check
$game_party.check_map_slip_damage
@sanity -= 2 if @sanity > 0
@sanity = 0 if @sanity < 0
end
end
end
def update
@frame_count += 1
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if (@frame_count % (Graphics.frame_rate / 2) == 0) && (@sanity < 100)
@sanity += 1
end
# Move player in the direction the directional button is being pressed
case Input.dir4
when 2
if @sanity != 0
move_down
@frame_count = 0
end
when 4
if @sanity != 0
move_left
@frame_count = 0
end
when 6
if @sanity != 0
move_right
@frame_count = 0
end
when 8
if @sanity != 0
move_up
@frame_count = 0
end
end
end
# Remember coordinates in local variables
last_real_x = @real_x
last_real_y = @real_y
super
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# Scroll map down
$game_map.scroll_down(@real_y - last_real_y)
end
# If character moves left and is positioned more let on-screen than
# center
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# Scroll map left
$game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than
# center
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# Scroll map right
$game_map.scroll_right(@real_x - last_real_x)
end
# If character moves up and is positioned higher than the center
# of the screen
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# Scroll map up
$game_map.scroll_up(last_real_y - @real_y)
end
# If not moving
unless moving?
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event
result = check_event_trigger_here([1,2])
# If event which started does not exist
if result == false
# Disregard if debug mode is ON and ctrl key was pressed
unless $DEBUG and Input.press?(Input::CTRL)
# Encounter countdown
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# If C button was pressed
if Input.trigger?(Input::C)
# Same position and front event determinant
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
def update_sanity?
end
end
class Window_HUD < Window_Base
def initialize
super(-16, -16, 128, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 18
self.opacity = 0
refresh
end
def refresh
reset_variables
self.contents.clear
self.contents.draw_text(5, 0, 64, 32, $data_system.words.hp)
self.contents.draw_text(5, 32, 64, 32, 'Sanity')
self.contents.fill_rect(5, 24, 64, 4, Color.new(0, 0, 0))
p = @hp * 64 / @mhp
self.contents.fill_rect(5, 24, p, 4, Color.new(255, 0, 0))
self.contents.fill_rect(5, 56, 64, 4, Color.new(0, 0, 0))
p = @sanity * 64 / 100
self.contents.fill_rect(5, 56, p, 4, Color.new(128, 0, 128))
draw_actor_graphic(@actor, 84, 64)
end
def reset_variables
@actor = $game_party.actors[0]
@hp = @actor ? @actor.hp : 0
@mhp = @actor ? @actor.maxhp : 0
@sanity = $game_player.sanity
end
def update
super
if (@actor = $game_party.actors[0] or
@hp = @actor ? @actor.hp : 0 or
@mhp = @actor ? @actor.maxhp : 0 or
@sanity = $game_player.sanity)
refresh
end
end
end
class Scene_Map
alias hud_main main
alias hud_update update
def main
@HUD = Window_HUD.new
hud_main
@HUD.dispose
end
def update
@HUD.update
hud_update
end
end
Too vague of a description
Code:
#---------------
# Skills Window
#---------------
class Window_HudSkills < Window_Base
def initialize
super(8, 8, 80, 285)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 180
self.opacity = 0
refresh
end
def refresh
self.contents.clear
@bitmap1 = RPG::Cache.picture("skillsback.png")
self.contents.blt(0, 0, @bitmap1, Rect.new(0, 0, @bitmap1.width,
@bitmap1.height))
@bitmap2 = RPG::Cache.picture("skillnums.png")
self.contents.blt(0, 0, @bitmap2, Rect.new(0, 0, @bitmap2.width,
@bitmap2.height))
for i in 1..5
next if !$ABS.skills[i]
x = 12
y = 12 + (i * 27)
skill = $data_skills[$ABS.skills[i]]
bitmap = RPG::Cache.icon(skill.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
end
Please note that ALL HUds that I make will be open source. Feel free to make edits to them as you please, as long as you credit the original version. If you don't like this, go and make your own HUD!