Since people just like HUD's, I'll start making some out of requests. I'll all post them here so that you can select what you want.
You can also request by yourself here. Please do, and I'll make it
Greatzz, SojaBird.
PS. Open the spoilers to see a example screenshot of each HUD.
You can also download the blueprint, so that any scripter with very little knowledge of scripting can make it's own HUD's with easy.
Version 3.2 _BluePrint.txt ( 6.49K )
Number of downloads: 482
Item, HP, MP: This HUD will show three things. An item (icon+value) and the HP and MP of one actor. The HUD can be faded when the player hit's the HUD.
CODE
################################################################################ # # # ~~~~~ Copyright 2009 SojaBird ~~~~~ # # # ################################################################################ module HUD_ITEM_HP_MP HUD_SWITCH = 1 # Turn this ON to show HUD
ITEM_ID = 1 # Id of item to show ACTOR_ID = 0 # Id of actor to show hp/mp (actor1=0, actor2=1...actorN=N-1)
HIDE = true # Hide if player is beneath the hud (true/false) OPACITY = 100 # Opacity when hidden end ################################################################################ class Window_HUD_Item_HP_MP < Window_Base include HUD_ITEM_HP_MP
def hide_status if HIDE == true if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = OPACITY self.contents_opacity = OPACITY else self.opacity = 255 self.contents_opacity = 255 end end end
def update self.visible = $game_switches[HUD_SWITCH] return if !self.visible if @icon != $game_party.item_number($data_items[ITEM_ID]) or @hp != @actor.hp or @mp != @actor.mp refresh end hide_status end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud start alias terminate_hud terminate alias update_hud update def start start_hud @item_hp_mp_hud = Window_HUD_Item_HP_MP.new end def terminate @item_hp_mp_hud.dispose terminate_hud end def update update_hud @item_hp_mp_hud.update end end
X/Y position (scripters-tool): If you want to know where the player is in the screen, you can just put this simple HUD in your scriptingboard to show it. Choose wheter to show the screen coordinates or just the map position.
CODE
################################################################################ # # # ~~~~~ Copyright 2009 SojaBird ~~~~~ # # # ################################################################################ module HUD_X_Y REAL_MAP = "MAP" # Real x/y coördinates or map position ("REAL", "MAP") VISIBLE = true # Visible or not (true/false) end ################################################################################
def refresh contents.clear case REAL_MAP when "REAL" @x = $game_player.real_x @y = $game_player.real_y when "MAP" @x = $game_player.x @y = $game_player.y end contents.draw_text(0, 0, self.width - 32, WLH, "X: #{@x}", 1) contents.draw_text(0, 24, self.width - 32, WLH, "Y: #{@y}", 1) end
def update case REAL_MAP when "REAL" if @x != $game_player.real_x or @y != $game_player.real_y refresh end when "MAP" if @x != $game_player.x or @y != $game_player.y refresh end end end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_xy_hud start alias terminate_xy_hud terminate alias update_xy_hud update def start start_xy_hud @x_y = Hud_X_Y.new end def terminate @x_y.dispose terminate_xy_hud end def update update_xy_hud @x_y.update end end
HP, MP, EXP, NAME, FACE, LEVEL: This HUD will show six things. The HP, MP, EXP, name, face-picture and level of one actor. The HUD can be faded when the player hit's the HUD. You can also enable to function to scroll through the actors with the L and R (default Q and W) buttons.
# To toggle the hud's display, just do a callscript "hud" # To set the hud's display, just do a callscript "hud(true)" or "hud(false)"
module HUD_HP_MP_EXP_NAME_FACE_LEVEL HUD_WIDTH = 126 # The width of the HUD (when 126, face will be drawn) FACE_OPACITY = 100 # The opacity of the background face (when HUD_WIDTH = 126)
BG_DISPLAY = true # Show or hide the backgroundwindow [true/false]
EXP_NAME = "E" # What should be displayed for the EXP
ACTOR_ID = 0 # Id of actor to show data of (actor1=0, actor2=1...actorN=N-1)
HIDE = true # Hide if player is beneath the HUD [true/false] OPACITY = 100 # Opacity when hidden [0-255]
HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
CYCLE = true # Wheter to enable to cyle through actors with L&R buttons end
################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ class Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL < Window_Base include HUD_HP_MP_EXP_NAME_FACE_LEVEL
def draw_actor_exp(actor, x, y, width) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_exp_gauge(actor, x, y, s1, s2, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, EXP_NAME) self.contents.font.color = normal_color last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2) end end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width) gw = width * s1 / s2 gc1 = text_color(31) gc2 = text_color(27) 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 update self.visible = $game_system.hud_display return if !self.visible if @hp != @actor.hp or @mp != @actor.mp or @exp != @actor.exp or @name != @actor.name or @level != @actor.level or @face != [@actor.face_name, @actor.face_index] refresh end hide_status end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hmexp_name_face_lvl start alias terminate_hmexp_name_face_lvl terminate alias update_hmexp_name_face_lvl update def start start_hmexp_name_face_lvl @index = HUD_HP_MP_EXP_NAME_FACE_LEVEL::ACTOR_ID new_hud
end def terminate @hp_mp_exp_name_face_hud.dispose terminate_hmexp_name_face_lvl end def update update_hmexp_name_face_lvl @hp_mp_exp_name_face_hud.update return if !HUD_HP_MP_EXP_NAME_FACE_LEVEL::CYCLE return if !@hp_mp_exp_name_face_hud.visible if Input.trigger?(Input::R) if @index == $game_party.members.size - 1 @index = 0 else @index += 1 end elsif Input.trigger?(Input::L) if @index == 0 @index = $game_party.members.size - 1 else @index -= 1 end end new_hud if @index != @hp_mp_exp_name_face_hud.index end
def new_hud @hp_mp_exp_name_face_hud.dispose if !@hp_mp_exp_name_face_hud.nil? @hp_mp_exp_name_face_hud = Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL.new(@index) end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = HUD_HP_MP_EXP_NAME_FACE_LEVEL::HUD_START_DISPLAY end end
HP, MP, G, NAME, FACE, LEVEL: This HUD will show the same things as the one above, though it has been modifief a bit so the EXP is replaced by the total gold amount (with icon). For more info on this HUD, see one above.
# To toggle the hud's display, just do a callscript "hud" # To set the hud's display, just do a callscript "hud(true)" or "hud(false)"
module HUD_HP_MP_G_NAME_FACE_LEVEL HUD_WIDTH = 126 # The width of the HUD (when 126, face will be drawn) FACE_OPACITY = 100 # The opacity of the background face (when HUD_WIDTH = 126)
BG_DISPLAY = true # Show or hide the backgroundwindow [true/false]
ACTOR_ID = 0 # Id of actor to show data of (actor1=0, actor2=1...actorN=N-1)
ICON_ID = 147 # Number of the gold icon
HIDE = true # Hide if player is beneath the HUD [true/false] OPACITY = 100 # Opacity when hidden [0-255]
HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false]
CYCLE = true # Wheter to enable to cyle through actors with L&R buttons end
################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ class Window_HUD_HP_MP_G_NAME_FACE_LEVEL < Window_Base include HUD_HP_MP_G_NAME_FACE_LEVEL
def draw_gold_amount(x, y) draw_icon(ICON_ID, x, y) draw_currency_value(@gold, x + 24, y, 94 - 24) end
def update self.visible = $game_system.hud_display return if !self.visible if @hp != @actor.hp or @mp != @actor.mp or @name != @actor.name or @level != @actor.level or @face != [@actor.face_name, @actor.face_index] or @gold != $game_party.gold refresh end hide_status end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hmp_g_name_face_lvl start alias terminate_hmp_g_name_face_lvl terminate alias update_hmp_g_name_face_lvl update def start start_hmp_g_name_face_lvl @index = HUD_HP_MP_G_NAME_FACE_LEVEL::ACTOR_ID new_hud end def terminate @hp_mp_g_name_face_hud.dispose terminate_hmp_g_name_face_lvl end def update update_hmp_g_name_face_lvl @hp_mp_g_name_face_hud.update return if !HUD_HP_MP_G_NAME_FACE_LEVEL::CYCLE return if !@hp_mp_g_name_face_hud.visible if Input.trigger?(Input::R) if @index == $game_party.members.size - 1 @index = 0 else @index += 1 end elsif Input.trigger?(Input::L) if @index == 0 @index = $game_party.members.size - 1 else @index -= 1 end end new_hud if @index != @hp_mp_g_name_face_hud.index end
def new_hud @hp_mp_g_name_face_hud.dispose if !@hp_mp_g_name_face_hud.nil? @hp_mp_g_name_face_hud = Window_HUD_HP_MP_G_NAME_FACE_LEVEL.new(@index) end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = HUD_HP_MP_G_NAME_FACE_LEVEL::HUD_START_DISPLAY end end
Vertical Bars: This HUD will show six things. The HP, MP, EXP, name and face-picture of one actor, and the gold amount with an icon (optional). The HUD can be faded when the player hit's the HUD.
def draw_actor_HUD_hp(actor, x, y, height) draw_actor_HUD_hp_gauge(actor, x + 2, y, height) self.contents.font.color = system_color self.contents.draw_text(x, y, @bw, WLH, Vocab::hp_a) self.contents.font.color = hp_color(actor) last_font_size = self.contents.font.size actor.hp.to_s.scan(/./).each do |i| y += 1 self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1) end end
def draw_actor_HUD_hp_gauge(actor, x, y, height) gh = (height - 16) * actor.hp / actor.maxhp gc1 = hp_gauge_color2 gc2 = hp_gauge_color1 self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color) y += height - gh - 16 if FILL_BOTTOM_UP self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true) end
def draw_actor_HUD_mp(actor, x, y, height) draw_actor_HUD_mp_gauge(actor, x + 2, y, height) self.contents.font.color = system_color self.contents.draw_text(x, y, @bw, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size actor.mp.to_s.scan(/./).each do |i| y += 1 self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1) end end
def draw_actor_HUD_mp_gauge(actor, x, y, height) gh = (height - 16) * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color2 gc2 = mp_gauge_color1 self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color) y += height - gh - 16 if FILL_BOTTOM_UP self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true) end
def draw_actor_HUD_exp(actor, x, y, height) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_HUD_exp_gauge(actor, x + 2, y, s1, s2, height) self.contents.font.color = system_color self.contents.draw_text(x, y, @bw, WLH, EXP_NAME) self.contents.font.color = normal_color last_font_size = self.contents.font.size actor.exp.to_s.scan(/./).each do |i| y += 1 self.contents.draw_text(x + 1, y * 14 + 10, 11, WLH, i, 1) end end
def draw_actor_HUD_exp_gauge(actor, x, y, s1, s2, height) gh = (height - 16) * s1 / s2 gc1 = text_color(27) gc2 = text_color(31) self.contents.fill_rect(x, y + WLH - 8, 10, height, gauge_back_color) y += height - gh - 16 if FILL_BOTTOM_UP self.contents.gradient_fill_rect(x, y + 16, 10, gh, gc1, gc2, true) end
def draw_gold_amount(x, y) draw_icon(ICON_ID, x, y) draw_currency_value(@gold, x + 24, y, 94 - 24) end
def update self.visible = $game_system.hud_display return if !self.visible if @hp != @actor.hp or @mp != @actor.mp or @exp != @actor.exp or @name != @actor.name or @face != [@actor.face_name, @actor.face_index] refresh end if @gold != $game_party.gold and ICON_ID != "" refresh end hide_status end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud start alias terminate_hud terminate alias update_hud update def start start_hud @vertical_bars_hud = Vertical_Bars_HUD.new end def terminate @vertical_bars_hud.dispose terminate_hud end def update update_hud @vertical_bars_hud.update end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Vertical_Bars::HUD_START_DISPLAY end end
Enemy amount 'MiniMap add-on': This HUD will show the amount of enemies that are still on the map. Though it'll only work when Woratana's MiniMap script is used. The style of the HUD is the same as the one for the minimap, it uses the same configuration. To let it work, place the add-on script below the original MiniMap script.
CODE
################################################################################ # # # ~~~~~ Copyright 2009 SojaBird ~~~~~ # # # ################################################################################ #------------------------------------------------------------ # * Game_MiniMap: Gets amount of enemies on the map #------------------------------------------------------------ class Game_MiniMap attr_reader :enemies
alias hud_initialize initialize alias draw_hud_object draw_object
def initialize(tilemap) @enemies = 0 hud_initialize(tilemap) end
def draw_object @enemies = 0 draw_hud_object @object_list.each do |key, events| color = MiniMap::OBJECT_COLOR[key] next if events.nil? or color.nil? events.each do |obj| if !obj.character_name.empty? @enemies += 1 if color == MiniMap::OBJECT_COLOR['enemy'] end end end end end
#------------------------------------------------------------ # * Woratana_MiniMap_Enemy_HUD: Creates the HUD #------------------------------------------------------------ class Woratana_MiniMap_Enemy_HUD < Window_Base include MiniMap
def refresh contents.clear draw_border if @border.nil? draw_background if @background.nil? @enemies = $scene.spriteset.minimap.enemies self.contents.font.color = color @string = "#{@enemies}/#{@enemies_total}" self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1) end
def dispose @border.dispose if !@border.nil? @background.dispose if !@background.nil? end
def update self.visible = $game_system.show_minimap return if !self.visible if $scene.is_a?(Scene_Map) and @enemies != $scene.spriteset.minimap.enemies refresh end end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud start alias terminate_hud terminate alias update_hud update def start start_hud @woratana_minimap_enemy_hud = Woratana_MiniMap_Enemy_HUD.new end def terminate @woratana_minimap_enemy_hud.dispose terminate_hud end def update update_hud @woratana_minimap_enemy_hud.update end end
All Name Hp Mp: This HUD will show the HP, MP, and name of all actors. The HUD can be faded when the player hit's the HUD.
# To toggle the hud's display, just do a callscript "hud" # To set the hud's display, just do a callscript "hud(true)" or "hud(false)"
module ALL_NAME_HP_MP HUD_SWITCH = 1 # Turn this ON to show HUD
ITEM_ID = 1 # Id of item to show ACTOR_ID = 0 # Id of actor to show hp/mp (actor1=0, actor2=1...actorN=N-1)
HIDE = true # Hide if player is beneath the hud (true/false) OPACITY = 100 # Opacity when hidden
WIDTH = 150 # The width of the HUD [>32-544] NAME_WIDTH = 50 # The width the name uses
BG_DISPLAY = true # Wheter to display the HUD's borderwindow [true/false]
HUD_START_DISPLAY = true # Wheter to display the HUD at start [true/false] end ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ class All_Name_Hp_Mp < Window_Base include ALL_NAME_HP_MP
def draw_actor_info(actor, info, x, y, width, height = WLH) case info when "name" self.contents.font.color = hp_color(actor) self.contents.draw_text(x, y, width, height, actor.name) when "hp" draw_actor_gauge(actor, info, x, y, width, height) when "mp" draw_actor_gauge(actor, info, x, y, width, height) end end
def draw_actor_gauge(actor, info, x, y, width, height) case info when "hp" gw = width * actor.hp / [actor.maxhp, 1].max gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 when "mp" gw = width * actor.mp / [actor.maxmp, 1].max gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 end self.contents.fill_rect(x, y, width, height, gauge_back_color) self.contents.gradient_fill_rect(x, y, gw, height, gc1, gc2) end
def draw_actor_mp(actor, x, y, width = 120) draw_actor_mp_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2) end end
def hide_status if HIDE == true if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = OPACITY if BG_DISPLAY self.contents_opacity = OPACITY else self.opacity = 255 if BG_DISPLAY self.contents_opacity = 255 end end end
def update self.visible = $game_system.hud_display return if !self.visible hide_status @m.each do |i| if @a_list[i.index][0] != i.name or @a_list[i.index][1] != i.hp or @a_list[i.index][2] != i.mp or @a_list[i.index][3] != i.level refresh end end end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud start alias terminate_hud terminate alias update_hud update def start start_hud @all_name_hp_mp = All_Name_Hp_Mp.new end def terminate @all_name_hp_mp.dispose terminate_hud end def update update_hud @all_name_hp_mp.update end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = ALL_NAME_HP_MP::HUD_START_DISPLAY end end
Tile ID reader (scripters-tool): If you want to know what kinda tile the player's at, you should press F5 in the test mode. It'll show a HUD at the bottom of the screen wich tells you the ID of the tile you're at.
def map_data @x = $game_player.x @y = $game_player.y @map_id = $game_map.map_id @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id)) @tile_id = [] for i in [2, 1, 0] tile_id = @map.data[@x, @y, i] @tile_id.push(tile_id) end return "#{@tile_id[2]} | #{@tile_id[1]} | #{@tile_id[0]}" end
def update self.visible = Input.press?(Input::F5) if $TEST if @x != $game_player.x or @y != $game_player.y refresh end end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_Hud_Tile_ID start alias terminate_Hud_Tile_ID terminate alias update_Hud_Tile_ID update def start start_Hud_Tile_ID @Hud_Tile_ID = Hud_Tile_ID.new end def terminate @Hud_Tile_ID.dispose terminate_Hud_Tile_ID end def update update_Hud_Tile_ID @Hud_Tile_ID.update end end
Tile ID Shower (BluePrint used) (scripter-tool): If you want to know what kinda tiles are on your map, just go in the testmode and find out.
# To toggle the hud's display, just do a callscript "hud" # To set the hud's display, just do a callscript "hud(true)" or "hud(false)"
module Tile_ID_Shower; WLH = Window_Base::WLH ################################################################################ # User Customazation Start_Display = true #true/false Opacity = 100 #0-255 BG_Display = false #true/false Hide = false #true/false ################################################################################ # Don't touch below (if ure're not a scripter) ################################################################################ =begin ######################################################################### Some standard value's you might want to use are allready pre-defiend so that you don't have to write the whole function for your self anymore. Here follows a list: (just copy+past and fill in the value's to let it work) * draw_actor_graphic(actor, x, y) * draw_actor_face(actor, x, y, size = 96) * draw_actor_name(actor, x, y) * draw_actor_class(actor, x, y) * draw_actor_level(actor, x, y) * draw_actor_state(actor, x, y, width = 96) * draw_actor_hp(actor, x, y, width = 120) * draw_actor_mp(actor, x, y, width = 120) * draw_actor_parameter(actor, x, y, type) FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi * draw_item_name(item, x, y, enabled = true) * draw_currency_value(value, x, y, width) =end ########################################################################### ################################################################################ def xywh @x = -16 #Set the x-position @y = -16 #Set the y-position @w = 544+32 #Set the width @h = 416+32 #Set the height return[@x, @y, @w, @h] end; def hud_values #Set the value's that you're using (also used at refresh) @display_x = $game_map.display_x/256 @display_y = $game_map.display_y/256 @map_id = $game_map.map_id @map = load_data(sprintf("Data/Map%03d.rvdata",@map_id)) #Example: @actor = $game_party.members[0] end; def hud_contents #Set the things you want to draw x = 0 y = 0 for i in @display_x..@display_x+17 for j in @display_y..@display_y+14 @tile_id = @map.data[i,j,1] @tile_id = @map.data[i,j,2] if @tile_id == 0 self.contents.draw_text(x*32,y*32,32,32,@tile_id,1) y += 1 end x += 1 y = 0 end #Example: draw_actor_hp(@actor, x, y) end; def hud_refresh?; if #Set wich value's make the HUD to refresh @display_x != $game_map.display_x/256 or @display_y != $game_map.display_y/256 or @map_id != $game_map.map_id #Example: if @actor != $game_party.members[0] return true; end end end ################################################################################ # Don't touch below ################################################################################
################################################################################ # Call script function ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ #------------------------------------------------------------ # * Hud_Name: Create Hud window #------------------------------------------------------------ class Hud_Tile_ID_Shower < Window_Base include Tile_ID_Shower
def initialize super(xywh[0],xywh[1],xywh[2],xywh[3]) self.visible = $game_system.hud_display self.opacity = Opacity self.opacity = 0 if !BG_Display hide_status if Hide hud_values refresh end
def refresh contents.clear hud_values hud_contents end
def hide_status if Hide if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = Opacity if BG_Display self.contents_opacity = Opacity else self.opacity = 255 if BG_Display self.contents_opacity = 255 end end end
def update self.visible = $game_system.hud_display return if !self.visible refresh if hud_refresh? hide_status if Hide end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud_name start alias terminate_hud_name terminate alias update_hud_name update def start start_hud_name @hud_tile_id_shower = Hud_Tile_ID_Shower.new if $TEST end def terminate @hud_tile_id_shower.dispose if !@hud_tile_id_shower.nil? terminate_hud_name end def update update_hud_name @hud_tile_id_shower.update if !@hud_tile_id_shower.nil? end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Tile_ID_Shower::Start_Display end end
Hp Mp Exp VarPic (BluePrint used): This HUD will show four things. The HP, MP and EXP of one actor, and a picture based on a variable. The HUD can be faded when the player hit's the HUD.
Picture_Variable = 1 #Number of the variable to use for the picture Picture_Name = "" #Name of the picture, in front of the variable value #Example: # Picture_Name = "hud" # Picture_Variable it's value = 1 # Picture that will be shown on the HUD = "hud1"
Actor_ID = 0 #The ID of the actor of wich the value's are displayed
Exp_Name = "E" #Name that will be displayed as Exp ################################################################################ # Don't touch below (if ure're not a scripter) ################################################################################ =begin ######################################################################### Some standard value's you might want to use are allready pre-defiend so that you don't have to write the whole function for your self anymore. Here follows a list: (just copy+past and fill in the value's to let it work) * draw_actor_graphic(actor, x, y) * draw_actor_face(actor, x, y, size = 96) * draw_actor_name(actor, x, y) * draw_actor_class(actor, x, y) * draw_actor_level(actor, x, y) * draw_actor_state(actor, x, y, width = 96) * draw_actor_hp(actor, x, y, width = 120) * draw_actor_mp(actor, x, y, width = 120) * draw_actor_parameter(actor, x, y, type) FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi * draw_item_name(item, x, y, enabled = true) * draw_currency_value(value, x, y, width)
Custom new standard functions: * draw_actor_exp(actor, x, y, width = 120) =end ########################################################################### ################################################################################ def xywh @x = 0 #Set the x-position @y = 0 #Set the y-position @w = 120+32 #Set the width @h = 3*WLH+32 #Set the height return[@x, @y, @w, @h] end; def hud_values #Set the value's that you're using (also used at refresh) @var = $game_variables[Picture_Variable] @actor = $game_party.members[Actor_ID] @hp = @actor.hp @mp = @actor.mp @exp = @actor.exp #Example: @actor = $game_party.members[0] end; def hud_contents #Set the things you want to draw draw_variable_picture(@var, 0, 0*WLH) draw_actor_hp(@actor, 0, 0*WLH) draw_actor_mp(@actor, 0, 1*WLH) draw_actor_exp(@actor, 0, 2*WLH) #Example: draw_actor_hp(@actor, x, y) end; def hud_refresh?; if #Set wich value's make the HUD to refresh @var != $game_variables[Picture_Variable] or @actor != $game_party.members[Actor_ID] or @hp != @actor.hp or @mp != @actor.mp or @exp != @actor.exp #Example: if @actor != $game_party.members[0] return true; end end end ################################################################################ # Don't touch below ################################################################################
################################################################################ # Call script function ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ #------------------------------------------------------------ # * Hp_Mp_Exp_VarPic: Create Hud window #------------------------------------------------------------ class Hp_Mp_Exp_VarPic < Window_Base include Hp_Mp_Exp_VarPic_Module
def initialize super(xywh[0],xywh[1],xywh[2],xywh[3]) self.visible = $game_system.hud_display self.opacity = Opacity self.opacity = 0 if !BG_Display hide_status if Hide hud_values refresh end
def refresh contents.clear hud_values hud_contents end
def hide_status if Hide if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = Opacity if BG_Display self.contents_opacity = Opacity else self.opacity = 255 if BG_Display self.contents_opacity = 255 end end end
def update self.visible = $game_system.hud_display return if !self.visible refresh if hud_refresh? hide_status if Hide end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hp_mp_exp_varpic start alias terminate_hp_mp_exp_varpic terminate alias update_hp_mp_exp_varpic update def start start_hp_mp_exp_varpic @hp_mp_exp_varpic = Hp_Mp_Exp_VarPic.new end def terminate @hp_mp_exp_varpic.dispose terminate_hp_mp_exp_varpic end def update update_hp_mp_exp_varpic @hp_mp_exp_varpic.update end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Hp_Mp_Exp_VarPic_Module::Start_Display end end
#------------------------------------------------------------ # * Window_Base: Some new standard function #------------------------------------------------------------ class Window_Base < Window
def draw_actor_exp(actor, x, y, width = 120) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_exp_gauge(actor, x, y, s1, s2, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Hp_Mp_Exp_VarPic_Module::Exp_Name) self.contents.font.color = normal_color last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2) end end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120) gw = width * s1 / s2 gc1 = text_color(31) gc2 = text_color(27) 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 end
Actor_Selector (BluePrint used): This HUD will show several things from the by you selected actor by using the L and R buttons (default Q and W). Those things are; HP, MP, EXP, FACE, NAME, CLASS and LEVEL. Also the gold amount will be shown, as well a indicator to display wich actor is selected. The HUD can be faded when the player hit's the HUD. You can also choose to put an key-input in the script so that the HUD only shows when that key is pressed.
#Put nil if you don't want to use it Visible_Key = Input::F5 #Input::__
EXP_NAME = "E" ################################################################################ # Don't touch below (if ure're not a scripter) ################################################################################ =begin ######################################################################### Some standard value's you might want to use are allready pre-defiend so that you don't have to write the whole function for your self anymore. Here follows a list: (just copy+past and fill in the value's to let it work) * draw_actor_graphic(actor, x, y) * draw_actor_face(actor, x, y, size = 96) * draw_actor_name(actor, x, y) * draw_actor_class(actor, x, y) * draw_actor_level(actor, x, y) * draw_actor_state(actor, x, y, width = 96) * draw_actor_hp(actor, x, y, width = 120) * draw_actor_mp(actor, x, y, width = 120) * draw_actor_parameter(actor, x, y, type) FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi * draw_item_name(item, x, y, enabled = true) * draw_currency_value(value, x, y, width)
Custom new standard functions: * draw_actor_exp(actor, x, y, width = 120) =end ########################################################################### ################################################################################ def xywh @x = 0 #Set the x-position @y = 0 #Set the y-position @w = 108+120+32 #Set the width @h = 7*WLH+32 #Set the height return[@x, @y, @w, @h] end; def hud_values #Set the value's that you're using (also used at refresh) @actor = $game_party.members[@index] @hp = @actor.hp @mp = @actor.mp @exp = @actor.exp @name = @actor.name @face = [@actor.face_name, @actor.face_index] @gold = $game_party.gold #Example: @actor = $game_party.members[0] end; def hud_contents #Set the things you want to draw draw_actor_face(@actor, 0, 0*WLH) draw_actor_hp(@actor, 108, 0*WLH) draw_actor_mp(@actor, 108, 1*WLH) draw_actor_exp(@actor, 108, 2*WLH) draw_actor_name(@actor, 0, 4*WLH) draw_actor_level(@actor, 108, 4*WLH) draw_index(@index, 108, 5*WLH) draw_actor_class(@actor, 0, 5*WLH) draw_currency_value(@gold, 0, 6*WLH, 108) #Example: draw_actor_hp(@actor, x, y) end; def hud_refresh?; if #Set wich value's make the HUD to refresh @hp != @actor.hp or @mp != @actor.mp or @exp != @actor.exp or @name != @actor.name or @face != [@actor.face_name, @actor.face_index] or @gold != $game_party.gold #Example: if @actor != $game_party.members[0] return true; end end end ################################################################################ # Don't touch below ################################################################################
################################################################################ # Call script function ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ #------------------------------------------------------------ # * Hud_Name: Create Hud window #------------------------------------------------------------ class Actor_Selector_HUD < Window_Base include Actor_Selector_HUD_Module
attr_reader :index
def initialize(index) @index = index super(xywh[0],xywh[1],xywh[2],xywh[3]) self.visible = $game_system.hud_display self.opacity = Opacity self.opacity = 0 if !BG_Display self.visible = Input.press?(Visible_Key) if !Visible_Key.nil? hide_status if Hide hud_values refresh end
def refresh contents.clear hud_values hud_contents end
def draw_index(index, x, y) count = 0 for i in 0..$game_party.members.size - 1 count = 0 if count == 5 @x = x + count * 24 if (i/5).ceil @y = (i/5).floor * WLH + y self.contents.font.color = normal_color self.contents.font.color = text_color(14) if i == @index self.contents.draw_text(@x, @y, WLH, 24, i+1, 1) count += 1 end end
def hide_status if Hide if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = Opacity if BG_Display self.contents_opacity = Opacity else self.opacity = 255 if BG_Display self.contents_opacity = 255 end end end
def update self.visible = Input.press?(Visible_Key) if !Visible_Key.nil? self.visible = $game_system.hud_display if Visible_Key.nil? return if !self.visible refresh if hud_refresh? hide_status if Hide end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_actor_selector_hud start alias terminate_actor_selector_hud terminate alias update_actor_selector_hud update def start start_actor_selector_hud @index = 0 new_hud end def terminate @actor_selector_hud.dispose terminate_actor_selector_hud end def update update_actor_selector_hud @actor_selector_hud.update return if !@actor_selector_hud.visible if Input.trigger?(Input::R) if @index == $game_party.members.size - 1 @index = 0 else @index += 1 end elsif Input.trigger?(Input::L) if @index == 0 @index = $game_party.members.size - 1 else @index -= 1 end end new_hud if @index != @actor_selector_hud.index end def new_hud @actor_selector_hud.dispose if !@actor_selector_hud.nil? @actor_selector_hud = Actor_Selector_HUD.new(@index) end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Actor_Selector_HUD_Module::Start_Display end end
#------------------------------------------------------------ # * Window_Base: Some new standard function #------------------------------------------------------------ class Window_Base < Window
def draw_actor_exp(actor, x, y, width = 120) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_exp_gauge(actor, x, y, s1, s2, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, Actor_Selector_HUD_Module::EXP_NAME) self.contents.font.color = normal_color last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2) end end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120) gw = width * s1 / s2 gc1 = text_color(31) gc2 = text_color(27) 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 end
Sprite Hp Mp Exp States (BluePrint used): This HUD will show five things from the selected actor. Selection can be made through the L and R buttons (default Q and W). Those things are; SPRITE, HP, MP, EXP and STATES. The HUD can be faded when the player hit's the HUD.
# To toggle the hud's display, just do a callscript "hud" # To set the hud's display, just do a callscript "hud(true)" or "hud(false)"
module Module_Name; WLH = Window_Base::WLH ################################################################################ # User Customazation Start_Display = true #true/false Opacity = 100 #0-255 BG_Display = true #true/false Hide = true #true/false EXP_NAME = "E" ################################################################################ # Don't touch below (if ure're not a scripter) ################################################################################ =begin ######################################################################### Some standard value's you might want to use are allready pre-defiend so that you don't have to write the whole function for your self anymore. Here follows a list: (just copy+past and fill in the value's to let it work) * draw_actor_graphic(actor, x, y) * draw_actor_face(actor, x, y, size = 96) * draw_actor_name(actor, x, y) * draw_actor_class(actor, x, y) * draw_actor_level(actor, x, y) * draw_actor_state(actor, x, y, width = 96) * draw_actor_hp(actor, x, y, width = 120) * draw_actor_mp(actor, x, y, width = 120) * draw_actor_parameter(actor, x, y, type) FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi * draw_item_name(item, x, y, enabled = true) * draw_currency_value(value, x, y, width)
Custom new standard functions: * draw_actor_exp(actor, x, y, width = 120) =end ########################################################################### ################################################################################ def xywh @x = 0 #Set the x-position @y = 0 #Set the y-position @w = 96+32 #Set the width @h = 72+24+32 #Set the height return[@x, @y, @w, @h] end; def hud_values #Set the value's that you're using (also used at refresh) @actor = $game_party.members[@index] @temp_states = @actor.states #Example: @actor = $game_party.members[0] end; def hud_contents #Set the things you want to draw draw_actor_graphic(@actor, 14, 42) draw_actor_hp(@actor, 32, 0, 93-32) draw_actor_mp(@actor, 32, 24, 96-32) draw_actor_exp(@actor, 0, 48, 96) draw_actor_state(@actor, 0, 72, 96) #Example: draw_actor_hp(@actor, x, y) end; def hud_refresh? if @temp_actor != @actor or @temp_actor.character_name != @actor.character_name or @temp_actor.character_index != @actor.character_index or @temp_actor.hp != @actor.hp or @temp_actor.mp != @actor.mp or @temp_actor.exp != @actor.exp or @temp_states != @actor.states @temp_states = @actor.states #Example: if @actor != $game_party.members[0] return true; end end end ################################################################################ # Don't touch below ################################################################################
################################################################################ # Call script function ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ #------------------------------------------------------------ # * Hud_Name: Create Hud window #------------------------------------------------------------ class Hud_Name < Window_Base include Module_Name
attr_reader :index
def initialize(index) @index = index super(xywh[0],xywh[1],xywh[2],xywh[3]) self.visible = $game_system.hud_display self.opacity = Opacity self.opacity = 0 if !BG_Display hide_status if Hide hud_values refresh end
def refresh contents.clear hud_values hud_contents end
def hide_status if Hide if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = Opacity if BG_Display self.contents_opacity = Opacity else self.opacity = 255 if BG_Display self.contents_opacity = 255 end end end
def update self.visible = $game_system.hud_display return if !self.visible refresh if hud_refresh? hide_status if Hide end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_hud_name start alias terminate_hud_name terminate alias update_hud_name update def start start_hud_name @index = 0 new_hud end def terminate @hud_name.dispose terminate_hud_name end def update update_hud_name @hud_name.update return if !@hud_name.visible if Input.trigger?(Input::R) if @index == $game_party.members.size - 1 @index = 0 else @index += 1 end elsif Input.trigger?(Input::L) if @index == 0 @index = $game_party.members.size - 1 else @index -= 1 end end new_hud if @index != @hud_name.index end def new_hud @hud_name.dispose if !@hud_name.nil? @hud_name = Hud_Name.new(@index) end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Module_Name::Start_Display end end
#------------------------------------------------------------ # * Window_Base: Some new standard function #------------------------------------------------------------ class Window_Base < Window include Module_Name
def draw_actor_exp(actor, x, y, width = 120) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_exp_gauge(actor, x, y, s1, s2, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, EXP_NAME) self.contents.font.color = normal_color last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2) end end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120) gw = width * s1 / s2 gc1 = text_color(31) gc2 = text_color(27) 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 end
Map Name (BluePrint used): This HUD will the map name the player is on. Maps can also be excluded and be replaced by other text (such as ???). The HUD can be faded when the player hit's the HUD. Also the position can be set.
Exclude_Map_IDs = [] Exclude_Display = "???" #Put "" to hide the window ################################################################################ # Don't touch below (if ure're not a scripter) ################################################################################ =begin ######################################################################### Some standard value's you might want to use are allready pre-defiend so that you don't have to write the whole function for your self anymore. Here follows a list: (just copy+past and fill in the value's to let it work) * draw_actor_graphic(actor, x, y) * draw_actor_face(actor, x, y, size = 96) * draw_actor_name(actor, x, y) * draw_actor_class(actor, x, y) * draw_actor_level(actor, x, y) * draw_actor_state(actor, x, y, width = 96) * draw_actor_hp(actor, x, y, width = 120) * draw_actor_mp(actor, x, y, width = 120) * draw_actor_parameter(actor, x, y, type) FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi * draw_item_name(item, x, y, enabled = true) * draw_currency_value(value, x, y, width)
Custom new standard functions: * draw_actor_exp(actor, x, y, width = 120) =end ########################################################################### ################################################################################ def xywh @w = 200 #Set the width @h = 24+32 #Set the height case Map_Name::Location when "TopLeft" @x = 0 #Set the x-position @y = 0 #Set the y-position when "TopCenter" @x = 544/2-@w/2 #Set the x-position @y = 0 #Set the y-position when "TopRight" @x = 544-@w #Set the x-position @y = 0 #Set the y-position when "BottomLeft" @x = 0 #Set the x-position @y = 416-32-24 #Set the y-position when "BottomCenter" @x = 544/2-@w/2 #Set the x-position @y = 416-32-24 #Set the y-position when "BottomRight" @x = 544-@w #Set the x-position @y = 416-32-24 #Set the y-position end return[@x, @y, @w, @h] end; def hud_values #Set the value's that you're using (also used at refresh) @map_info ||= load_data("Data/MapInfos.rvdata") @map_name = @map_info[$game_map.map_id].name @map_id = $game_map.map_id #Example: @actor = $game_party.members[0] end; def hud_contents #Set the things you want to draw draw_map_name(@map_name) #Example: draw_actor_hp(@actor, x, y) end; def hud_refresh?; if @map_id != @map_info[@map_id].name #Example: if @actor != $game_party.members[0] return true; end end
def draw_map_name(map_name) text = map_name text = Exclude_Display if Exclude_Map_IDs.include?($game_map.map_id) self.contents.draw_text(0, 0, self.width - 32, WLH, text, 1) self.visible = !(Exclude_Map_IDs.include?($game_map.map_id) and text == "") end end
################################################################################ # Call script function ################################################################################ def hud(arg = nil) $game_system.hud_display = !$game_system.hud_display if arg == nil $game_system.hud_display = arg if arg != nil end ################################################################################ #------------------------------------------------------------ # * Hud_Name: Create Hud window #------------------------------------------------------------ class Map_Name_Hud < Window_Base include Map_Name
def initialize super(xywh[0],xywh[1],xywh[2],xywh[3]) self.visible = $game_system.hud_display self.opacity = Opacity self.opacity = 0 if !BG_Display hide_status if Hide hud_values refresh end
def refresh contents.clear hud_values hud_contents end
def hide_status if Hide if $game_player.screen_x + 16 > self.x and $game_player.screen_y + 4 > self.y and $game_player.screen_x - 16 < self.x + self.width and $game_player.screen_y - 28 < self.y + self.height self.opacity = Opacity if BG_Display self.contents_opacity = Opacity else self.opacity = 255 if BG_Display self.contents_opacity = 255 end end end
def update self.visible = $game_system.hud_display return if !self.visible refresh if hud_refresh? hide_status if Hide end end
#------------------------------------------------------------ # * Scene_Map: Attach HUD to map #------------------------------------------------------------ class Scene_Map < Scene_Base alias start_map_name_hud start alias terminate_map_name_hud terminate alias update_map_name_hud update alias fadein_map_name_hud fadein def start start_map_name_hud @map_name_hud = Map_Name_Hud.new end def terminate @map_name_hud.dispose terminate_map_name_hud end def update update_map_name_hud @map_name_hud.update end def fadein(duration) @map_name_hud.refresh fadein_map_name_hud(duration) end end
#------------------------------------------------------------ # * Game_System: Check for display #------------------------------------------------------------ class Game_System alias hud_initialize initialize attr_accessor :hud_display def initialize hud_initialize @hud_display = Map_Name::Start_Display end end
#------------------------------------------------------------ # * Window_Base: Some new standard function #------------------------------------------------------------ class Window_Base < Window include Map_Name
def draw_actor_exp(actor, x, y, width = 120) s1 = actor.exp_s s2 = actor.next_rest_exp_s + s1 if s1.is_a? String or s2.is_a? String s1 = actor.exp s2 = actor.exp end draw_actor_exp_gauge(actor, x, y, s1, s2, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, EXP_NAME) self.contents.font.color = normal_color last_font_size = self.contents.font.size xr = x + width if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2) end end
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
Sure I can Though I've a hard time figuring out how to go read the amount of enemies are on the map for the other request. But yes, I'll see what I can do
Oh and for the gold thing, you could set the icon_id to "", then it'll be gone
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)