Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

ATS (Adv. Time System) and Mini-map..

Use this:
Code:
class Window_MrMo_HUD < Window_Base
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.color = normal_color
    self.contents.font.size = 12
    @actor = $game_party.actors[0]
    @old_hp = @actor.hp
    @old_sp = @actor.sp
    @old_exp = @actor.exp
    @level = @actor.level
    @hp_n = $game_party.item_number(HP_ITEMID)
    @sp_n = $game_party.item_number(SP_ITEMID)
    @gold_n = $game_party.gold
    @states = @actor.states.to_s
    @dash = $ABS.dash_min
    @sneak = $ABS.sneak_min
    @time = game_time
    @time = $kts.time.to_s if $kts != nil
    bitmap = RPG::Cache.picture("HUD Graphic")
    self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 175, 175))
    bitmap = RPG::Cache.picture("HUD Display")
    self.contents.blt(15, 380, bitmap, Rect.new(0, 0, 175, 175))
    bitmap = RPG::Cache.picture("HUD Time Display")
    self.contents.blt(553.5, 338.5, bitmap, Rect.new(0, 0, 175, 175))
    bitmap = RPG::Cache.picture("Hotkeys HUD")
    self.contents.blt(250, -10, bitmap, Rect.new(0, 0, 400, 80))
    if MINI_MAP
      bitmap = RPG::Cache.picture("Mini-Map HUD")
      self.contents.blt(493, 362.5, bitmap, Rect.new(0, 0, 175, 175))
      map_infos = load_data("Data/MapInfos.rxdata")
      name = map_infos[$game_map.map_id].name.to_s
      name.gsub!(/[|].*/) {|ats| ats=""}
      self.contents.draw_text(520, 455, 400, 32, name.to_s)
    end
    bitmap = RPG::Cache.icon("HP Symbol")
    self.contents.blt(0, -2, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(35, -9, 640, 32, "HP")
    draw_gradient_bar(HP_X, HP_Y, @actor.hp, @actor.maxhp, HP_BAR, HP_WIDTH, HP_HEIGHT)
    bitmap = RPG::Cache.icon("SP Symbol")
    self.contents.blt(0, 18, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(35, 11, 640, 32, "SP")
    draw_gradient_bar(SP_X, SP_Y, @actor.sp, @actor.maxsp, SP_BAR, SP_WIDTH, SP_HEIGHT)
    bitmap = RPG::Cache.icon("EXP Symbol")
    self.contents.blt(0, 37, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(35, 30, 640, 32, "EXP")
    min = @actor.level == 99 ? 1 : @actor.now_exp
    max = @actor.level == 99 ? 1 : @actor.next_exp
    draw_gradient_bar(EXP_X, EXP_Y, min, max, EXP_BAR, EXP_WIDTH, EXP_HEIGHT)
    bitmap = RPG::Cache.icon("Hero")
    self.contents.blt(2, 59, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(35, 49, 640, 32, "Hero:")
    self.contents.draw_text(30, 59, 640, 32, @actor.name.to_s)
    bitmap = RPG::Cache.icon("Level")
    self.contents.blt(2, 81, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(33, 72, 640, 32, "Level:")
    self.contents.draw_text(43, 82, 640, 32, @actor.level.to_s)
    bitmap = RPG::Cache.icon("Gold")
    self.contents.blt(35, 390, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(30, 400, 640, 32, $game_party.gold.to_s)
    self.contents.font.color = system_color
    self.contents.font.color = normal_color
    self.contents.font.size = 14
    self.contents.draw_text(570, 270, 175, 175, @time.to_s)
    if @actor.hp.to_i <= LOW_HP
      bitmap = RPG::Cache.icon("Skull")
      self.contents.blt(130, 0, bitmap, Rect.new(0, 0, 24, 24))
    end
    if $game_party.item_number(SP_ITEMID) > 0
      bitmap = RPG::Cache.icon("SP Potion")
      self.contents.blt(110, 20, bitmap, Rect.new(0, 0, 24, 24))
    end
    if $game_party.item_number(HP_ITEMID) > 0
      bitmap = RPG::Cache.icon("HP Potion")
      self.contents.blt(110, 0, bitmap, Rect.new(0, 0, 24, 24))
    end
    if STATES_SHOW
      begin
        n = -2
        for id in @actor.states
          state = $data_states[id]
          next if state == nil
          bitmap = RPG::Cache.picture("States Display")
          x = (n*40) + 185
          self.contents.blt(x, 50, bitmap, Rect.new(0, 0, 49, 58))
          n += 1
        end
        n = -2
        for id in @actor.states
          state = $data_states[id]
          next if state == nil
          bitmap = RPG::Cache.icon(state.name+"_Icon")
          x = (n*40) + +195
          self.contents.blt(x, 65, bitmap, Rect.new(0, 0, 24, 24))
          self.contents.draw_text(x, 66.5, 49, 58, state.name.to_s)
          n += 1
        end
      rescue
        print "#{$!} - Don't ask Mr.Mo for it!!!"
      end
    end
    if HOTKEYS_SHOW
      count = 0
      for id in $ABS.skill_keys.values
        next if id == nil
        skill = $data_skills[id]
        next if skill == nil
        icon = RPG::Cache.icon(skill.icon_name)
        x = (count*32) + 280
        self.contents.blt(x, 27, icon, Rect.new(0, 0, 200, 100))
        self.contents.draw_text(x, 33, 49, 58, skill.name.to_s)
        count += 1
      end
    end
    self.contents.font.size = 20
    self.contents.draw_text(DASH_X - 40, DASH_Y-10, 40, 32, "") if SHOW_DASH
    draw_gradient_bar(DASH_X, DASH_Y, $ABS.dash_min, $ABS.dash_max, DASH_BAR, DASH_WIDTH, DASH_HEIGHT) if SHOW_DASH
    self.contents.draw_text(SNEAK_X - 40, SNEAK_Y-10, 40, 32, "") if SHOW_SNEAK
    draw_gradient_bar(SNEAK_X, SNEAK_Y, $ABS.sneak_min, $ABS.sneak_max, SNEAK_BAR, SNEAK_WIDTH, SNEAK_HEIGHT) if SHOW_SNEAK
  end
end
 
Hold on... another question.

Using that same script, how would I say the time in the game (by event, ex. I press enter on clock and it says the time)?

Also, how would I tell the season too?
 
Use this: (for displaying time in a window message, with event commands)
Code:
@> Script: $game_variable[id] = $ats.clock
@> Message: \v[id]
Change id to the variable you want to use.

For display the season, use "$ats.season" insteand of "$ats.clock", in the previous script.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top