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.

EXP Bar? Surprised this isn't up.

ikos

Member

Has anyone made/seen one? I've looked just about everywhere and I've yet to see one.
Anyone?  :thumb:

~ikos out
 

khmp

Sponsor

Mean1 please don't post if you have nothing constructive to add.

ikos, what are you looking for exactly? An exp bar in Window_MenuStatus, that's the window that appears in the Menu? Or Window_Status, that's the window that appears in the Status screen? Or both? If it's in the Status screen do you want it to replace the current the current exp number and the number of exp to the next level? What colors do you want to use for the bar if it's a gradient. Do you want it to fill left to right, right to left? Do you want the number of the exp to be drawn on top of it? Do you want it to be drawn in similar fashion to the HP Bar? What string do you want drawn on top of it? 'E', 'Exp', 'XP'?
 

ikos

Member

khmp":agp3cas3 said:
Mean1 please don't post if you have nothing constructive to add.

ikos, what are you looking for exactly? An exp bar in Window_MenuStatus, that's the window that appears in the Menu? Or Window_Status, that's the window that appears in the Status screen? Or both? If it's in the Status screen do you want it to replace the current the current exp number and the number of exp to the next level? What colors do you want to use for the bar if it's a gradient. Do you want it to fill left to right, right to left? Do you want the number of the exp to be drawn on top of it? Do you want it to be drawn in similar fashion to the HP Bar? What string do you want drawn on top of it? 'E', 'Exp', 'XP'?

Alright, I will give you exactly what I imagined.
On the Menu, it would replace Actor Class.
On the Status menu, it would replace the EXP/NEXT bits.
The bar would be a simple yellow-gold to orange-gold gradient.
And I would like EXP to be the string.
 

Mean1

Member

Couldnt you pull it from the pokestarter kit? The thing is it wont show up on the menu screen...and you prolly would have to change the color but simple html stuff should fix that
 

khmp

Sponsor

Alright I would suggest a few things first. Shrinking the "EXP" to just "E". Experience numbers can become larger than the maximum hp and sp numbers so I would also suggest requesting the size of the font being drawn be turned down. But this is all up to you.

Script Installation:
To install the script create an empty section under "Materials" in the script editor's script listings and paste inside the section the code below.

VX Code:
Code:
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Constant Variables
  #--------------------------------------------------------------------------
  EXP_COLOR1 = Color.new(255, 255, 100)
  EXP_COLOR2 = Color.new(255, 192, 40)
  EXP_BAR_STRING = 'EXP'
  #--------------------------------------------------------------------------
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : Width
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y, width = 120)
    draw_actor_exp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, EXP_BAR_STRING)
    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, actor.exp_s, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.exp_s, 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.next_exp_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw EXP gauge
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : Width
  #--------------------------------------------------------------------------
  def draw_actor_exp_gauge(actor, x, y, width = 120)
    gw = width * actor.exp / actor.next_exp_s.to_i
    gc1 = EXP_COLOR1
    gc2 = EXP_COLOR2
    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
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh                                                      !OVERRIDE!
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_exp(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
end

#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
#  This window displays full status specs on the status screen.
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 128, 0)
    draw_actor_exp(@actor, 128, 56)
    draw_actor_face(@actor, 8, 32)
    draw_basic_info(128, 32)
    draw_parameters(32, 160)
    draw_equipments(288, 160)
  end
end

Good luck with it ikos! :thumb:
 

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