Jump to content
Sign in to follow this  
Nicke

Simple Gold Hud

Recommended Posts

I'm using this script for a very long time but  doesn't appear in my game screen.

I've changed the font name, position, but it still not appearing.  :(



yeah me too.
i've put the script and not touch anything on it and no one's changing.
i noticed the switch id is 1, but i don't know what button is that.

The switch ID is 1...create an event on the map..now get the event command window, then choose control switches option.Choose the first switch. name it Gold Hud and press ok.then make sure the trigger in selected as "On"..now again press ok until event manager is closed..save and test the game, walk to the event and press enter and the gold hud will be shown..It is the way to show up the gold hud..

Share this post


Link to post
Share on other sites

This script just doesn't seem to work for me no matter what I do. I've read the instructions about 50000 times and read this page as many times. If someone could please post a demo of this working I'd be very grateful.

Share this post


Link to post
Share on other sites

I apologize for reviving this topic as I can see it has been dead for over a year now... But I am encountering a problem that seems to have been brought up earlier in this thread, but never resolved. Even after I activate the control switch, the window doesn't appear until the menu is opened and closed. Does anyone know why this is happening? 
And it doesn't have to just be the menu. The character naming window, or F9 window can be activated and then closed to make the hud appear. (After the switch is on of course.)

Share this post


Link to post
Share on other sites

Hey, someone asked for this in the script support forums over at RPG maker web.

 

Solution:

#-------------------------------------
# Xail's Simple Gold HUD fix - mjshi
#-------------------------------------
# Addon Version (paste below Xail's
# Simple Gold HUD)
#-------------------------------------
class Scene_Map
  def check_gold_hud
    @gold_window.visible = $game_switches[XAIL::GOLD::GOLD[1]]
  end
end

Or, if you don't want individual scripts:

 

 

#==============================================================================
#   Simple Gold Hud
#   Author: Nicke, update method fixed by mjshi
#   Created: 06/06/2012
#   Edited: 20/03/2013
#   Version: 1.0e
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#==============================================================================
# Requires: XS - Core Script.
#==============================================================================
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-SIMPLE-GOLD-HUD"] = true

module XAIL
  module GOLD
  #--------------------------------------------------------------------------#
  # * Settings
  #--------------------------------------------------------------------------#
    # FONT = [name, size, color, bold, shadow]
    FONT = [["Ankladaâ„¢","Verdana"], 20, Color.new(255,255,255), true, true]

    # GOLD_WINDOW = [width, x, y , opacity, skin]
    WINDOW =  [160, 405, 375,  200, 0, ""]

    # GOLD = [icon, switch_id, show_icon, show_vocab, count_switch]
    GOLD =   [361, 1, true, false, 1]

    # GOLD_COUNT = [sound, vol, pitch, play]
    GOLD_COUNT = ["", 60, 100, false]

    # Count timer for updating the gold.
    GOLD_COUNT_WAIT = 4
    # The time lapse between gold count changing.
    GOLD_CHANGING = 1
  end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Error Handler
#==============================================================================#
  unless $imported["XAIL-XS-CORE"]
    # // Error handler when XS - Core is not installed.
    msg = "The script %s requires the latest version of XS - Core in order to function properly."
    name = "XS - Gold HUD"
    msgbox(sprintf(msg, name))
    exit
  end
#==============================================================================#
# ** Window_Gold_Hud
#------------------------------------------------------------------------------
#  Class for drawing the gold.
#==============================================================================#
class Window_Gold_Hud < Window_Base

  def initialize
    # // Method to initialize the gold window.
    super(0, 0, window_width, fitting_height(1))
    @last_gold = $game_party.gold
    @wait_period = XAIL::GOLD::GOLD_COUNT_WAIT
    refresh
  end

  def window_width
    # // Method to return the width.
    return XAIL::GOLD::WINDOW[0]
  end

  def draw_gold(value, unit, x, y, width)
    # // Method to draw the gold.
    cx = text_size(unit).width
    contents.font = Font.new(XAIL::GOLD::FONT[0], XAIL::GOLD::FONT[1])
    contents.font.color = XAIL::GOLD::FONT[2]
    contents.font.bold = XAIL::GOLD::FONT[3]
    contents.font.shadow = XAIL::GOLD::FONT[4]
    # // Draw gold.
    draw_text(x, y, width - cx - 9, line_height, value, 2)
    # // Draw vocab.
    draw_text(x, y, width, line_height, unit, 2) if XAIL::GOLD::GOLD[3]
    reset_font_settings
  end

  def refresh
    # // Method to refresh the gold.
    contents.clear
    if $game_switches[XAIL::GOLD::GOLD[4]]
      draw_gold($game_party.gold, Vocab::currency_unit, -10, 0, contents.width - 8)
    else
      draw_gold(@last_gold, Vocab::currency_unit, -10, 0, contents.width - 8)
    end
    draw_icon(XAIL::GOLD::GOLD[0], 100, -2) if XAIL::GOLD::GOLD[2]
  end

  def update
    # // Method to update the gold.
    super
    @wait_period -= 1 if @wait_period != 0
    if @last_gold != $game_party.gold and @wait_period == 0
      if @last_gold < $game_party.gold
        @last_gold += 1
      else
        @last_gold -= 1
      end
      if self.visible
        Sound.play(XAIL::GOLD::GOLD_COUNT[0], XAIL::GOLD::GOLD_COUNT[1], XAIL::GOLD::GOLD_COUNT[2]) if XAIL::GOLD::GOLD_COUNT[3]
      end
      refresh
      @wait_period = XAIL::GOLD::GOLD_CHANGING
    end
  end

end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  Show gold window on the map.
#==============================================================================
class Scene_Map < Scene_Base

  alias xail_gold_hud_create_all_windows create_all_windows
  def create_all_windows(*args, &block)
    # // Method to create all windows.
    xail_gold_hud_create_all_windows(*args, &block)
    create_gold_window 
    check_gold_hud
  end
  
  def create_gold_window
    # // Method to create the gold window.
    @gold_window = Window_Gold_Hud.new
    @gold_window.x = XAIL::GOLD::WINDOW[1]
    @gold_window.y = XAIL::GOLD::WINDOW[2]
    @gold_window.z = XAIL::GOLD::WINDOW[3]
    @gold_window.opacity = XAIL::GOLD::WINDOW[4]
    @gold_window.windowskin = Cache.system(XAIL::GOLD::WINDOW[5]) unless XAIL::GOLD::WINDOW[5] == ""
  end

  alias xail_gold_window_update update
  def update(*args, &block)
    # // Method to update the gold window on the map.
    xail_gold_window_update(*args, &block)
    check_gold_hud
  end
  
  def check_gold_hud
    @gold_window.visible = $game_switches[XAIL::GOLD::GOLD[1]]
  end
end # END OF FILE

#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#

 

 

Edited by innovation

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted