[XP] Exp, HP and SP HUD

Started by Futendra, November 05, 2011, 05:37:39 am

Previous topic - Next topic

Futendra

November 05, 2011, 05:37:39 am Last Edit: November 05, 2011, 07:32:03 am by Futendra
Exp, HP and SP HUD
Authors: Moghunter
Version: 2.0
Type: HUD
Key Term: Blizz-ABS Plugin



Introduction

This HUD uses images that are easily customisable and very easy to set up.



Features

  • HP Bar

  • SP Bar

  • EXP Bar

  • Lvl Display

  • Face in HUD





Screenshots
Spoiler: ShowHide




Demo
The Demo



Script
Spoiler: ShowHide
#_______________________________________________________________________________
# MOG - C Hud 2.0 (Classic Hud)      
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Hud estilo clássico.
#
# ARQUIVOS NECESSÁRIOS
#
# C_Layout
# C_Exp_Meter
# C_Layout
# C_HP_Meter
# C_SP_Meter
# Hud_HP_Number
# Hud_SP_Number
# Hud_Exp_Number
#
# Deixe as imagens na pasta Windowskins
#_______________________________________________________________________________
# HISTÓRICO
# 30/12/2010 (v2.0) -> Melhor codificação e compatibilidade.
#_______________________________________________________________________________
module MOG_C_HUD
   #Posição geral da HUD
   HUD_POS = [0,0]
   #Posição do numero de HP
   HP_NUMBER_POS = [120,5]
   #Posição do medidor de HP
   HP_METER_POS = [140,5]
   #Posição do numero de SP
   SP_NUMBER_POS = [80,25]
   #Posição do medidor de SP
   SP_METER_POS = [100,25]
   #Posição posição do level
   LEVEL_POS = [55,0]  #Posição posição do medidor de exp
   LEVEL_METER_POS = [72,47]
   #Posição dos ícones de status
   STATES_POS = [460,0]
   #Deixar a HUD opaco caso o herói estiver em cima da HUD.
   FADE = true
   #Tamanho planejado da hud, isso influência no sensor do FADE.
   HUD_SIZE = [420,64]
   #Switch que desativa a HUD
   DISABLE_C_HUD_SWITCH = 5
   #Prioridade da hud. (Z)
   HUD_PRIORITY = 5000
end
 
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler  
 
 #--------------------------------------------------------------------------
 # * Now Exp
 #--------------------------------------------------------------------------
 def now_exp
     return @exp - @exp_list[@level]
 end  
 
 #--------------------------------------------------------------------------
 # * Next Exp
 #--------------------------------------------------------------------------
 def next_exp
     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
 end
end

#==============================================================================
# ** C_Hud
#==============================================================================
class C_Hud < Sprite  
 include MOG_C_HUD
 
 #--------------------------------------------------------------------------
 # * Initialize
 #--------------------------------------------------------------------------
 def initialize(viewport)
     super(viewport)
     @actor = $game_party.actors[0]
     return if @actor == nil
     setup
     create_layout
     create_hp_number
     create_hp_meter
     create_sp_number
     create_sp_meter
     create_level_number
     create_level_meter
     create_state
     update_visible
     sp_flow_update
     sp_number_refresh        
     hp_flow_update
     hp_number_refresh  
 end

 #--------------------------------------------------------------------------
 # * Setup
 #--------------------------------------------------------------------------
 def setup
     @low_sp = 30
     @low_hp = 30
     @hp = @actor.hp
     @sp = @actor.sp
     @exp = @actor.exp
     @level = @actor.level
     @hp_old = @actor.hp
     @hp_ref = @hp_old
     @hp_refresh = false
     @sp_old = @actor.sp
     @sp_ref = @sp_old
     @sp_refresh = false
     hud_size_x = HUD_SIZE[0]
     hud_size_y = HUD_SIZE[1]
     @oc_range_x = hud_size_x + HUD_POS[0]
     @oc_range_y = hud_size_y + HUD_POS[1]
 end  
   
 #--------------------------------------------------------------------------
 # * Create Layout  
 #--------------------------------------------------------------------------  
 def create_layout  
     @layout_sprite = Sprite.new
     @layout_sprite.bitmap = RPG::Cache.windowskin("C_Layout")
     @layout_sprite.z = 1 + HUD_PRIORITY
     @layout_sprite.x = HUD_POS[0]
     @layout_sprite.y = HUD_POS[1]    
 end  
 
 #--------------------------------------------------------------------------
 # * Create HP Number  
 #--------------------------------------------------------------------------  
 def create_hp_number
     @hp_number_image = RPG::Cache.windowskin("Hud_HP_Number")
     @hp_number_bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
     @hp_number_sprite = Sprite.new
     @hp_number_sprite.bitmap = @hp_number_bitmap
     @hp_number_sprite.z = 3 + HUD_PRIORITY
     @hp_number_sprite.x = HUD_POS[0] + HP_NUMBER_POS[0]
     @hp_number_sprite.y = HUD_POS[1] + HP_NUMBER_POS[1]
     @im_cw = @hp_number_image.width / 10
     @im_ch = @hp_number_image.height / 2    
     @hp_src_rect = Rect.new(@im_cw,0, @im_cw, @im_ch)
     @hp_number_text = @actor.hp.abs.to_s.split(//)
     lowhp2 = @actor.maxhp * 30 / 100
     if @actor.hp < lowhp2
        @health2 = @im_ch
     else
        @health2 = 0
     end
     @hp_health = @health2
     for r in 0..@hp_number_text.size - 1        
        @hp_number_abs = @hp_number_text[r].to_i
        @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, @hp_health, @im_cw, @im_ch)
        @hp_number_bitmap.blt(20 + ((@im_cw - 7) *  r), 0, @hp_number_image, @hp_src_rect)        
     end        
 end  
 
 #--------------------------------------------------------------------------
 # * Create HP Meter
 #--------------------------------------------------------------------------    
 def create_hp_meter
     @hp_flow = 0
     @hp_damage_flow = 0
     @hp_image = RPG::Cache.windowskin("C_HP_Meter")
     @hp_bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
     @hp_range = @hp_image.width
     @hp_width = @hp_range  * @actor.hp / @actor.maxhp  
     @hp_height = @hp_image.height
     @hp_width_old = @hp_width
     @hp_src_rect = Rect.new(@hp_range, 0, @hp_width, @hp_height)
     @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
     @hp_sprite = Sprite.new
     @hp_sprite.bitmap = @hp_bitmap
     @hp_sprite.z = 2 + HUD_PRIORITY
     @hp_sprite.x = HUD_POS[0] + HP_METER_POS[0]
     @hp_sprite.y = HUD_POS[1] + HP_METER_POS[1]  
 end

 #--------------------------------------------------------------------------
 # * Create SP Number
 #--------------------------------------------------------------------------      
 def create_sp_number
     @sp_number_image = RPG::Cache.windowskin("Hud_SP_Number")
     @sp_number_bitmap = Bitmap.new(@sp_number_image.width,@sp_number_image.height)
     @sp_number_sprite = Sprite.new
     @sp_number_sprite.bitmap = @sp_number_bitmap
     @sp_number_sprite.z = 3 + HUD_PRIORITY
     @sp_number_sprite.x = HUD_POS[0] + SP_NUMBER_POS[0]
     @sp_number_sprite.y = HUD_POS[1] + SP_NUMBER_POS[1]
     @sp_im_cw = @sp_number_image.width / 10
     @sp_im_ch = @sp_number_image.height / 2    
     @sp_src_rect = Rect.new(@sp_im_cw,0, @sp_im_cw, @sp_im_ch)
     @sp_number_text = @actor.sp.abs.to_s.split(//)
     for r in 0..@sp_number_text.size - 1
        @sp_number_abs = @sp_number_text[r].to_i
        @sp_src_rect = Rect.new(@sp_im_cw * @sp_number_abs, 0, @sp_im_cw, @sp_im_ch)
        @sp_number_bitmap.blt(20 + ((@sp_im_cw - 7) *  r), 0, @sp_number_image, @sp_src_rect)        
     end          
 end  
 
 #--------------------------------------------------------------------------
 # * Create SP Meter
 #--------------------------------------------------------------------------        
 def create_sp_meter
     @sp_flow = 0
     @sp_damage_flow = 0
     @sp_image = RPG::Cache.windowskin("C_SP_Meter")
     @sp_bitmap = Bitmap.new(@sp_image.width,@sp_image.height)
     @sp_range = @sp_image.width
     @sp_width = @sp_range  * @actor.sp / @actor.maxsp  
     @sp_height = @sp_image.height
     @sp_width_old = @sp_width
     @sp_src_rect = Rect.new(@sp_range, 0, @sp_width, @sp_height)
     @sp_bitmap.blt(0,0, @sp_image, @sp_src_rect)
     @sp_sprite = Sprite.new
     @sp_sprite.bitmap = @sp_bitmap
     @sp_sprite.z = 2 + HUD_PRIORITY
     @sp_sprite.x = HUD_POS[0] + SP_METER_POS[0]
     @sp_sprite.y = HUD_POS[1] + SP_METER_POS[1]  
 end  
 
 #--------------------------------------------------------------------------
 # * Create Level Number
 #--------------------------------------------------------------------------          
 def create_level_number
     @level_number_image = RPG::Cache.windowskin("Hud_Exp_Number")
     @level_number_bitmap = Bitmap.new(@level_number_image.width,@level_number_image.height)
     @level_number_sprite = Sprite.new
     @level_number_sprite.bitmap = @level_number_bitmap
     @level_number_sprite.z = 3 + HUD_PRIORITY
     @level_number_sprite.x = HUD_POS[0] + LEVEL_POS[0]
     @level_number_sprite.y = HUD_POS[1] + LEVEL_POS[1]
     @level_im_cw = @level_number_image.width / 10
     @level_im_ch = @level_number_image.height    
     @level_number_text = @actor.level.abs.to_s.split(//)
     for r in 0..@level_number_text.size - 1
        @level_number_abs = @level_number_text[r].to_i
        @level_src_rect = Rect.new(@level_im_cw * @level_number_abs, 0, @level_im_cw, @level_im_ch)
        @level_number_bitmap.blt(13 + ((@level_im_cw - 12) *  r), 0, @level_number_image, @level_src_rect)        
     end        
 end  
 
 #--------------------------------------------------------------------------
 # * Create Level Meter
 #--------------------------------------------------------------------------          
 def create_level_meter
     @level_image = RPG::Cache.windowskin("C_Exp_Meter")
     @level_bitmap = Bitmap.new(@level_image.width,@level_image.height)
     @level_sprite = Sprite.new  
     rate = @actor.now_exp.to_f / @actor.next_exp
     rate = 1 if @actor.next_exp == 0
     @level_cw = @level_image.width * rate
     @level_cw = @level_image.width if @actor.level == 99
     @level_src_rect_back = Rect.new(0, 0,@level_cw, @level_image.height)
     @level_bitmap.blt(0,0, @level_image, @level_src_rect_back)
     @level_sprite.bitmap = @level_bitmap
     @level_sprite.z = 2 + HUD_PRIORITY
     @level_sprite.x = HUD_POS[0] + LEVEL_METER_POS[0]
     @level_sprite.y = HUD_POS[1] + LEVEL_METER_POS[1]    
  end  
   
 #--------------------------------------------------------------------------
 # * Create State
 #--------------------------------------------------------------------------            
 def create_state
      @states_max = 0
      @states = Sprite.new
      @states.bitmap = Bitmap.new(156,24)
      @states_x = @actor.states.size
      @states_y = 0
      @states_f = false
      sta = []
      for i in @actor.states
         unless @states_max > 5
             sta.push($data_states[i].name)
             image = RPG::Cache.icon(sta[@states_max])
             cw = image.width
             ch = image.height
             @states.bitmap.blt(26 * @states_max, 0, image, Rect.new(0, 0, cw, ch))
             @states_max += 1
         end
      end  
      @states.x = HUD_POS[0] + STATES_POS[0]
      @states.y = HUD_POS[1] + STATES_POS[1]
      @states.z = 4 + HUD_PRIORITY              
  end  
 
 #--------------------------------------------------------------------------
 # * Dispose
 #--------------------------------------------------------------------------
 def dispose
     return if @actor == nil
     #Layout Dispose
     @layout_sprite.bitmap.dispose
     @layout_sprite.dispose
     #Hp Number Dispose
     @hp_number_sprite.bitmap.dispose
     @hp_number_sprite.dispose
     @hp_number_bitmap.dispose
     #HP Meter Dispose
     @hp_sprite.bitmap.dispose
     @hp_sprite.dispose
     @hp_bitmap.dispose
     #SP Number Dispose
     @sp_number_sprite.bitmap.dispose
     @sp_number_sprite.dispose
     @sp_number_bitmap.dispose
     #SP Meter Dispose
     @sp_sprite.bitmap.dispose
     @sp_sprite.dispose
     @sp_bitmap.dispose
     #Level Number Dispose
     @level_number_sprite.bitmap.dispose
     @level_number_sprite.dispose
     @level_number_bitmap.dispose
     #Level Meter Dispose
     @level_sprite.bitmap.dispose
     @level_sprite.dispose
     @level_bitmap.dispose
     #States Dispose
     @states.bitmap.dispose
     @states.dispose
     @states = nil
     super
 end  
 
 #--------------------------------------------------------------------------
 # * Updade
 #--------------------------------------------------------------------------
 def update
     super
      return if @actor == nil
      update_visible
      hp_number_update if @hp_old != @actor.hp
      hp_number_refresh if @hp_refresh == true or @actor.hp == 0
      sp_number_update if @sp_old != @actor.sp
      sp_number_refresh if @sp_refresh == true    
      level_update if @level != @actor.level    
      exp_update if @exp != @actor.exp
      hp_flow_update
      sp_flow_update
      update_fade if FADE == true
      update_states
 end
 
 #--------------------------------------------------------------------------
 # * update fade
 #--------------------------------------------------------------------------
 def update_fade
     x = ($game_player.real_x - $game_map.display_x) / 4
     y = ($game_player.real_y - $game_map.display_y) / 4
     if x < @oc_range_x and x > HUD_POS[0] - 5 and
        y > HUD_POS[1] - 5 and y < @oc_range_y and
          @hp_number_sprite.opacity > 120
          @hp_number_sprite.opacity -= 10
          @hp_sprite.opacity -= 10
          @sp_number_sprite.opacity -= 10
          @sp_sprite.opacity -= 10
          @states.opacity -= 10
          @level_sprite.opacity -= 10
          @level_number_sprite.opacity -= 10
          @layout_sprite.opacity -= 10
     elsif @hp_number_sprite.opacity < 255
          @hp_number_sprite.opacity += 10
          @hp_sprite.opacity += 10
          @sp_number_sprite.opacity += 10
          @sp_sprite.opacity += 10
          @states.opacity += 10
          @level_sprite.opacity += 10
          @level_number_sprite.opacity += 10
          @layout_sprite.opacity += 10
    end
 end    
 
 #--------------------------------------------------------------------------
 # * Update States
 #--------------------------------------------------------------------------
 def update_states
     @states.x = HUD_POS[0] + STATES_POS[0]
     @states.y = HUD_POS[1] + STATES_POS[1]
     if @states_x != @actor.states.size
        @states_x = @actor.states.size
        @states.bitmap.clear
        @states_max = 0
        sta = []
        for i in @actor.states
          unless @states_max > 5
            sta.push($data_states[i].name)
            image = RPG::Cache.icon(sta[@states_max])
            cw = image.width
            ch = image.height
            @states.bitmap.blt(26 * @states_max, 0, image, Rect.new(0, 0, cw, ch))
            @states_max += 1
          end
        end  
      sta = nil
    end
  end
 
 #--------------------------------------------------------------------------
 # * update_visible
 #--------------------------------------------------------------------------
 def update_visible
     if $game_switches[DISABLE_C_HUD_SWITCH] == true
        hud_visible = false
     else  
        hud_visible = true
     end  
     @layout_sprite.visible = hud_visible
     @hp_number_sprite.visible = hud_visible
     @hp_sprite.visible = hud_visible
     @sp_number_sprite.visible = hud_visible
     @sp_sprite.visible = hud_visible
     @level_number_sprite.visible = hud_visible
     @states.visible = hud_visible
 end
 
 #--------------------------------------------------------------------------
 # * hp_number_update
 #--------------------------------------------------------------------------
 def hp_number_update
      @hp_refresh = true
      if @hp_old < @actor.hp
          @hp_ref = 5 * (@actor.hp - @hp_old) / 100
          @hp_ref = 1 if @hp_ref < 1
          @hp += @hp_ref    
          if @hp >= @actor.hp
             @hp_old = @actor.hp
             @hp = @actor.hp  
             @hp_ref = 0
          end              
       elsif @hp_old > @actor.hp  
          @hp_refresh = true
          @hp_ref = 5 * (@hp_old - @actor.hp) / 100
          @hp_ref = 1 if @hp_ref < 1
          @hp -= @hp_ref                
          if @hp <= @actor.hp
             @hp_old = @actor.hp
             @hp = @actor.hp  
             @hp_ref = 0
          end            
       end  
  end    
 
 #--------------------------------------------------------------------------
 # * hp_number_refresh
 #--------------------------------------------------------------------------
 def hp_number_refresh
     @hp_number_sprite.bitmap.clear
     @hp = 0 if @actor.hp == 0
     @hp_number_text = @hp.abs.to_s.split(//)
     lowhp2 = @actor.maxhp * @low_hp / 100
     if @actor.hp < lowhp2
        @health2 = @im_ch
     else
        @health2 = 0
     end
     @hp_health = @health2
     for r in 0..@hp_number_text.size - 1        
        @hp_number_abs = @hp_number_text[r].to_i
        @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, @hp_health, @im_cw, @im_ch)
        @hp_number_bitmap.blt(20 + ((@im_cw - 7) *  r), 0, @hp_number_image, @hp_src_rect)        
      end  
      @hp_refresh = false if @hp == @actor.hp
 end  
 
 #--------------------------------------------------------------------------
 # * Hp Flow Update
 #--------------------------------------------------------------------------
 def hp_flow_update
     @hp_sprite.bitmap.clear
     @hp_width = @hp_range  * @actor.hp / @actor.maxhp
         #HP Damage---------------------------------
         valor = (@hp_width_old - @hp_width) * 3 / 100
         valor = 0.5 if valor < 1          
         if @hp_width_old != @hp_width
            @hp_width_old -= valor if @hp_width_old > @hp_width
            @hp_width_old = 0 if @actor.hp == 0
            if @hp_width_old < @hp_width
               @hp_width_old = @hp_width
            end      
            @hp_src_rect_old = Rect.new(@hp_flow, 0,@hp_width_old, @hp_height)
            @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect_old)      
         end        
     #HP Real------------------------------------
     @hp_src_rect = Rect.new(@hp_flow, 0,@hp_width, @hp_height)
     @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
 end          
 
 #--------------------------------------------------------------------------
 # * Sp_number_update
 #--------------------------------------------------------------------------
 def sp_number_update
     @sp_refresh = true
     if @sp_old < @actor.sp
        @sp_refresh = true
        @sp_ref = 5 * (@actor.sp - @sp_old) / 100
        @sp_ref = 1 if @sp_ref < 1
        @sp += @sp_ref  
        if @sp >= @actor.sp
           @sp_old = @actor.sp
           @sp = @actor.sp  
           @sp_ref = 0
        end  
     elsif @sp_old >= @actor.sp    
        @sp_ref = 5 * (@sp_old - @actor.sp) / 100
        @sp_ref = 1 if @sp_ref < 1
        @sp -= @sp_ref    
        if @sp <= @actor.sp
           @sp_old = @actor.sp
           @sp = @actor.sp  
           @sp_ref = 0
         end          
     end    
 end  
 
 #--------------------------------------------------------------------------
 # * sp_number_refresh
 #--------------------------------------------------------------------------
 def sp_number_refresh
   @sp_number_sprite.bitmap.clear
   @s = @actor.sp * 100 / @actor.maxsp
   @sp_number_text = @sp.abs.to_s.split(//)
     for r in 0..@sp_number_text.size - 1        
        @sp_number_abs = @sp_number_text[r].to_i
        if @actor.sp <= @actor.maxsp * @low_sp / 100
           @sp_src_rect = Rect.new(@sp_im_cw * @sp_number_abs, @sp_im_ch, @sp_im_cw, @sp_im_ch)  
        else  
           @sp_src_rect = Rect.new(@sp_im_cw * @sp_number_abs, 0, @sp_im_cw, @sp_im_ch)
        end
        @sp_number_bitmap.blt(20 + ((@sp_im_cw - 7) *  r), 0, @sp_number_image, @sp_src_rect)        
    end  
    @sp_refresh = false if @sp == @actor.sp
 end    
 
 #--------------------------------------------------------------------------
 # * Sp Flow Update
 #--------------------------------------------------------------------------
 def sp_flow_update
     @sp_sprite.bitmap.clear
     @sp_width = @sp_range  * @actor.sp / @actor.maxsp
         #SP Damage---------------------------------
         if @sp_width_old != @sp_width
         valor = (@sp_width_old - @sp_width) * 3 / 100
         valor = 0.5 if valor < 1              
         @sp_width_old -= valor if @sp_width_old > @sp_width  
         if @sp_width_old < @sp_width
            @sp_width_old = @sp_width
         end      
         @sp_src_rect_old = Rect.new(@sp_flow, 0,@sp_width_old, @sp_height)
         @sp_bitmap.blt(0,0, @sp_image, @sp_src_rect_old)
         end
     #SP Real------------------------------------
     @sp_src_rect = Rect.new(@sp_flow, 0,@sp_width, @sp_height)
     @sp_bitmap.blt(0,0, @sp_image, @sp_src_rect)
   end  
 
 #--------------------------------------------------------------------------
 # * level_update
 #--------------------------------------------------------------------------
 def level_update
     @level_number_sprite.bitmap.clear
     @level_number_text = @actor.level.abs.to_s.split(//)
     for r in 0..@level_number_text.size - 1
        @level_number_abs = @level_number_text[r].to_i
        @level_src_rect = Rect.new(@level_im_cw * @level_number_abs, 0, @level_im_cw, @level_im_ch)
        @level_number_bitmap.blt(13 + ((@level_im_cw - 12) *  r), 0, @level_number_image, @level_src_rect)        
     end      
     @level = @actor.level
 end  
 
 #--------------------------------------------------------------------------
 # * exp_update
 #--------------------------------------------------------------------------
 def exp_update
     @level_sprite.bitmap.clear    
     rate = @actor.now_exp.to_f / @actor.next_exp
     rate = 1 if @actor.next_exp == 0
     @level_cw = @level_image.width * rate
     @level_cw = @level_image.width if @actor.level == 99
     @level_src_rect_back = Rect.new(0, 0,@level_cw, @level_image.height)
     @level_bitmap.blt(0,0, @level_image, @level_src_rect_back)  
     @exp = @actor.exp
 end    
end  

#===============================================================================
# ** Spriteset_Map
#===============================================================================
class Spriteset_Map
 
 #--------------------------------------------------------------------------
 # * initialize
 #--------------------------------------------------------------------------
 alias mog_chud_initialize initialize
 def initialize
     @cthud = C_Hud.new(@viewport3)    
     mog_chud_initialize
 end
 
 #--------------------------------------------------------------------------
 # * Dispose
 #--------------------------------------------------------------------------
 alias mog_chud_dispose dispose
 def dispose
     mog_chud_dispose
     @cthud.dispose
 end  
   
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 alias mog_chud_update update
 def update
     mog_chud_update
     @cthud.update
 end      
end    

$mog_rgssxp_c_hud = true
 




Images
Spoiler: ShowHide












Instructions
Put the script underneath everything and above main.
Put the images in the Picture folder.



Compatibility
Probably not compatible with other HUD's



Credits and Thanks

  • Moghunter




Author's Notes
The script is in Portugese, but the names of everything are english!

NOTE: I found this script, I did not make it.

Blizzard

Quote from: topic title[Blizz-ABS] Exp, HP and SP HUD


Since when is "Blizz-ABS" an RPG Maker?

Quote from: Blizzard on January 07, 2008, 08:51:26 pm
1.

If you make a script for RGSS (RMXP), please add the [XP] tag in your title and separate the script name from the tag with a space.
If you make a script for RGSS2 (RMVX), please add the [VX] tag in your title and separate the script name from the tag with a space.
If your script can work in both languages and both makers, feel free to add both tags. Do NOT use a collective tag like [XP/VX]! BOTH tags have to be there!
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Futendra

Quote from: Blizzard on November 05, 2011, 07:11:08 am
Quote from: topic title[Blizz-ABS] Exp, HP and SP HUD


Since when is "Blizz-ABS" an RPG Maker?

Quote from: Blizzard on January 07, 2008, 08:51:26 pm
1.

If you make a script for RGSS (RMXP), please add the [XP] tag in your title and separate the script name from the tag with a space.
If you make a script for RGSS2 (RMVX), please add the [VX] tag in your title and separate the script name from the tag with a space.
If your script can work in both languages and both makers, feel free to add both tags. Do NOT use a collective tag like [XP/VX]! BOTH tags have to be there!


Misread that, soz

LiTTleDRAgo

 is this okay to post mog's script here without asking mog himself?
also, I think the bar is too long, only make the screen more crowded

Holyrapid

Also, and i do not mean to offend but, ever heard of Z-Hud?
Same thing done by the man himself.

Futendra

November 05, 2011, 05:03:30 pm #5 Last Edit: November 05, 2011, 05:10:46 pm by Futendra
Quote from: DesPKP on November 05, 2011, 03:36:20 pm
Also, and i do not mean to offend but, ever heard of Z-Hud?
Same thing done by the man himself.


I just thought people could use this as this has an EXP bar in it. I searched a HUD with an EXP bar in it for a week and found this, maybe others dont have to search? Also, this HUD uses a layout and bars, not only bars and empty bars. (I prefer to use this HUD with the hotkeys of Z-HUD and soms Z-HUD add-ons)

Quote from: LiTTleDRAgo on November 05, 2011, 11:51:03 am
is this okay to post mog's script here without asking mog himself?
also, I think the bar is too long, only make the screen more crowded

I didn't ask him but I don't think he'll mind that I promote hes script? But if its not allowed, you can delete the topic?

Boba Fett Link

Este es en Espanol.

Anyway, it looks allright, and has some features Z-HUD doesn't have.
This post will self-destruct in 30 seconds.

chaucer

hope im not necro posting :^_^': was just hopin someone could help me with this script I'm tryin to make it compatible wiith Fluctuating EXP script found here https://forum.chaos-project.com/index.php/topic,2051.0.html even if you just show me what should be changed some help is better than none. thanks in advance.

Futendra

Quote from: chaucer on January 21, 2012, 08:32:59 am
hope im not necro posting :^_^': was just hopin someone could help me with this script I'm tryin to make it compatible wiith Fluctuating EXP script found here https://forum.chaos-project.com/index.php/topic,2051.0.html even if you just show me what should be changed some help is better than none. thanks in advance.


I think the only problem can be script order, put the Level difference script before this one, or te other way around if it doesn't work. The scripts don't effect eachother normally?

chaucer

January 21, 2012, 12:54:42 pm #9 Last Edit: January 21, 2012, 12:55:49 pm by chaucer
I'm sorry i didnt even specify the problem im a little tired its not that theyre not compatible its just that when i use them both the exp hud after it fills up and you go to lvl 2 or higher the exp bar stays filled up no matter what.

Edit: i tried it both above and below and its the same both ways ><

Futendra

Quote from: chaucer on January 21, 2012, 12:54:42 pm
I'm sorry i didnt even specify the problem im a little tired its not that theyre not compatible its just that when i use them both the exp hud after it fills up and you go to lvl 2 or higher the exp bar stays filled up no matter what.

Edit: i tried it both above and below and its the same both ways ><


I have no idea what this might be, I didn't make this script and its in portugese  :facepalm:

chaucer

January 22, 2012, 01:58:02 pm #11 Last Edit: January 22, 2012, 02:01:56 pm by chaucer
ok two more questions is it possible to have the exp displayed in a % ratio? and what coding would i use to display the characters name with Font? i mostly just need the name with font lol the % is just curiousity

Futendra

Quote from: chaucer on January 22, 2012, 01:58:02 pm
ok two more questions is it possible to have the exp displayed in a % ratio? and what coding would i use to display the characters name with Font? i mostly just need the name with font lol the % is just curiousity
no, % isn't possible, maybe with a lot of editting or something but it's not made to use %, and for the Font, you'll have to search yourself

G_G

Actually it wouldn't take a whole lot of editing to convert it to %. Its just simple math.

chaucer

Awesome! do you think you could assist me in scripting the % in? im not very sure on where to even start on such a edit. where would i start to convert this to a % ratio?

Ununoctium

Well you could just divide the actors current experience by how much is necessary to get to the next level, and multiply it by 100.

Here's a script I made of such a thing a while ago(although it was for Window_Base):
Spoiler: ShowHide
 class Window_Base
   #--------------------------------------------------------------------------
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 24, 32, "E")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 84, 32, exp_percent(actor).ceil.to_s + "%")
  end
  def exp_percent(actor)
    return actor.exp.to_f / actor.next_exp * 100
  end
end
class Game_Actor
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] : "100"
  end
end

Stray

How do I make the bars running faster?
I'm very grateful to you all for your great help.

Danger Force

nice work on some of my game projects 8)

Stray

I can't switch it off with the switch?
How do I hide it?
I'm very grateful to you all for your great help.

KK20

    #Switch que desativa a HUD
    DISABLE_C_HUD_SWITCH = 5

If Switch ID 5 is ON, then the HUD is not visible.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Stray

August 10, 2013, 07:35:21 pm #20 Last Edit: August 10, 2013, 07:46:07 pm by Stray
Doesn't work for me.

EDIT:
It works now. I re-imported the script in my database and tried it again. Maybe I accidentally changed something in the script.
I'm very grateful to you all for your great help.

MarkHest

I find this HUD very interesting and I would like to use it, however it has some major flaws. Too often when I try other menu scripts and such the health bar's Z Layer is way over the menus and remains visible even when I navigate menus in some scripts. How can I lower the Z to something more fitting?
   

KK20


    #Prioridade da hud. (Z)
    HUD_PRIORITY = 5000

:???:

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

MarkHest

There's a problem though. No matter what I change it to, it remains. I have no idea why....

I even tried changing it to 0 or a negative number.
   

KK20

I see now. The HUD is drawn on another viewport.

  #--------------------------------------------------------------------------
  # * initialize
  #--------------------------------------------------------------------------
  alias mog_chud_initialize initialize
  def initialize
      @cthud = C_Hud.new(@viewport3)   
      mog_chud_initialize
  end

Try using @viewport1 first and see if that's all fine and dandy for you.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

MarkHest

I believe that worked. Thank you :)
   

Sin86

I apologize for necro posting but does anybody still have the example images that are required to use the HUD? The pictures no longer display as I believe the links are dead.