Jump to content

Recommended Posts

EXP Gauges V1.4

by Rbahamut


Introduction
This script will add an EXP Gauge to the Menu status as well as replace the exp info with a EXP Gauge in the Status window

Features
-Plug n Play
-Customizable ( if you know what to look for)
-Will make exp info more accessible
-With V 1.4 Gauges are now accurate after level 2!!! Never noticed anything was wrong with it before

Screenshots

post-526-0-20614900-1344718577_thumb.png
Showing exp gauges on Menu status
post-526-0-29399700-1344718585_thumb.png
Showing exp gauge in Status window
post-526-0-86502300-1344718591_thumb.png
Showing exp gauges in Menu status after a battle
post-526-0-85422000-1344718597_thumb.png
Showing exp gauge in Status window after leveling



How to Install
-place under Materials, above Main Process

Demo
V1.0 Without RTP http://www.mediafire...lokcdrddjy36xkd <=== out of date
V1.0 With RTP http://www.mediafire...u9ordj1r9tc29t5 <=== out of date

Script

 

#----------------------------------------------------------------------------
# EXP gauges by Rbahamut
#----------------------------------------------------------------------------
# v1.4
#----------------------------------------------------------------------------
# Changes in 1.4 - EXP Gauges now work properly passed level 2! (There was a
# problem with the gauge not filling all the way past level 2)
# Changes in v1.3 - Adjusted ui to fit gauges properly in "Skills" window and
# other variations of the same window such as YEA Class changing window, etc
# Changes in v1.2 - Added another customizing capability of changing the
#                    gauge back color when empty!
# Changes in v1.1 - No more exp clearing on leveling!
#----------------------------------------------------------------------------
# RGSS3 only Plug n Play
#----------------------------------------------------------------------------
#*This script will add exp gauges to both the menu status and status windows
#----------------------------------------------------------------------------
# Edit below at own risk!
#----------------------------------------------------------------------------


class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Get Text Colors
  #--------------------------------------------------------------------------

  def exp_gauge_color1;      text_color(11);  end;  # EXP gauge added lower half
  def exp_gauge_color2;      text_color(3);   end;  # EXP gauge added upper half
  def exp_gauge_back_color;  text_color(19);  end;  # EXP Gauge background

  #--------------------------------------------------------------------------
  # * Draw exp Gauge
  #     rate   : Rate (full at 1.0)
  #     color1 : Left side gradation
  #     color2 : Right side gradation
  #--------------------------------------------------------------------------
  def draw_expgauge(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    contents.fill_rect(x, gauge_y, width, 6, exp_gauge_back_color)
    contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  end
  #--------------------------------------------------------------------------
  # * Draw EXP  This is the exp info to be drawn on the "menu" status
  #--------------------------------------------------------------------------
  def draw_exp(actor, x, y, width = 124)
        s1 = actor.max_level? ? "---------" : actor.exp
        s2 = actor.max_level? ? "0" : actor.next_level_exp - actor.exp
        if actor.max_level? ?
          draw_expgauge(x, y, width, 1, exp_gauge_color1, exp_gauge_color2) :
          draw_gauge(x, y,width,((((actor.exp - actor.current_level_exp).to_f/100) / ((actor.next_level_exp.to_f - actor.current_level_exp.to_f)/100))),  
          exp_gauge_color1, exp_gauge_color2)
        end
        change_color(system_color)
        draw_text(x, y, 30, line_height, "EXP")
        change_color(normal_color)
        if actor.max_level? ?
          draw_text(x + width - 72, y, 72, line_height, "------------", 2) :
          draw_text(x + width - 72, y, 72, line_height, actor.next_level_exp.to_i - actor.exp.to_i, 2)
        end
  end
  #--------------------------------------------------------------------------
  # * Draw Simple Status
  #--------------------------------------------------------------------------
  def draw_actor_simple_status(actor, x, y)
        draw_actor_name(actor, x, y + line_height *  -0.3)
        draw_actor_level(actor, x, y + line_height * 0.7)
        draw_actor_icons(actor, x, y + line_height * 1.7)
        draw_actor_class(actor, x + 120, y + line_height * -0.3)
        draw_actor_hp(actor, x + 120, y + line_height * 0.7)
        draw_actor_mp(actor, x + 120, y + line_height * 1.7)
        draw_exp(actor, x + 120, y + line_height * 2.7) #<== This line adds the exp gauge to "menu" status
  end
end

class Window_Status < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw  New Experience Information This is the exp info to be drawn in the "status" window
  #--------------------------------------------------------------------------
  def draw_exp_info(x, y)
        s1 = @actor.max_level? ? "-------" : @actor.exp
        s2 = @actor.max_level? ? "0" : @actor.next_level_exp - @actor.exp
        if @actor.max_level? ?
          draw_gauge(x, y + line_height * 3, 130, 1, exp_gauge_color1, exp_gauge_color2) :
          draw_gauge(x, y + line_height * 3, 130,((((@actor.exp - @actor.current_level_exp).to_f/100) / ((@actor.next_level_exp.to_f - @actor.current_level_exp.to_f)/100))),
          exp_gauge_color1, exp_gauge_color2)
        end
        s_next = sprintf(Vocab::ExpNext, Vocab::level)
        change_color(system_color)
        draw_text(x, y + line_height * 3, 30, line_height, "EXP")
        draw_text(x, y + line_height * 2, 180, line_height, s_next)
        draw_text(255, y + line_height * 3, 180, line_height, s2, 2)
        change_color(normal_color)
        if @actor.max_level? ?
          draw_text(x + width - 72, y, 72, line_height, "------------", 2) :
          draw_text(x + width - 72, y, 72, line_height, @actor.next_level_exp.to_i - @actor.exp.to_i, 2)
        end
  end
end

 



FAQ

Q: Does the exp I gain carry over into the next level?
A: Yes it does!!! Thanks to Xypher, whom had a great catch with the line of code!

Credit and Thanks
To my lil bro who was whining about all the other exp gauges not working this way and pushing me to get it out there.
BIG thanks to Xypher for figuring out how to not need to wipe exp every level to ensure the exp gauge empties upon leveling!

Author's Notes
This is my first standalone script and though it is not all that advanced or anything, I would like ppl to be honest about how it is, let me know of any bugs and credit if you plan on usin for commercial game.

Edited by rbahamut

Share this post


Link to post
Share on other sites

Why didn't you just

draw_gauge(x, y + line_height * 3, 130,((((@actor.exp - @actor.current_level_exp).to_f/100) / (@actor.next_level_exp.to_f/100))), exp_gauge_color1, exp_gauge_color2)

No need to reset exp every level that way.

Share this post


Link to post
Share on other sites

Why didn't you just

draw_gauge(x, y + line_height * 3, 130,((((@actor.exp - @actor.current_level_exp).to_f/100) / (@actor.next_level_exp.to_f/100))), exp_gauge_color1, exp_gauge_color2)

No need to reset exp every level that way.

Thanks Xypher... i swear i tried that before and it failed... prolly had the current exp part in wrong area.. thanks man ill edit u into the credits :)

Share this post


Link to post
Share on other sites

I thought this was pretty amusing though

 

change_exp(self.exp - self.exp, true)

You like that? lol seriously is my first script I have VERY little programming experience in VB and C++ and never touched RGSS at all so i think i did ok butobviously need to learn moar before im any REAL good.

Share this post


Link to post
Share on other sites

Ok after testing compatability with Yanfly's Status Screen I have found a working method!!!!

Step 1 Take my Custom EXP Gauges V1.2 script and put it BELOW Yanfly's Status Screen script

Step 2 Copy these line of codes and paste them in yanflys status script in the area marked "DRAW GENERAL EXPERIENCE" ( line 562 ish just put it under the draw text but above the end :) )

draw_gauge(dx, dy + line_height * 3, 130, 1, exp_gauge_color1, exp_gauge_color2)
draw_gauge(dx, dy + line_height * 3, 130,((((@actor.exp - @actor.current_level_exp).to_f/100) / (@actor.next_level_exp.to_f/100))),
	   exp_gauge_color1, exp_gauge_color2)

Edited by rbahamut

Share this post


Link to post
Share on other sites

Hmm, I get an error as soon as I try to enter the menu:

Script 'EXP Gauges by Rbahamut' line 44: NoMethedError occurred.

undefined method 'next_level_EXP' for#<Game_Actor:0x6984a08>

Tested it in a completely new, blank game. So it's not conflicting with other scripts.

Share this post


Link to post
Share on other sites

I am not getting that error in a fresh new game without extra scripts, nor with other scripts... Im thinking re copy and paste or somethings wrong with ur client. It literally takes the built in exp requirements and just draws a gauge. I will continue to try and reproduce that error in the meantime.

Share this post


Link to post
Share on other sites

All right, the problem seems to have fixed itself O.o

I feel like a real tool now, because honest to God I can't recreate the error either. Even though I got it several times yesterday. So, never mind. It was probaly an error on my part.

Sorry for the trouble.

 

Thank you for this script. It's really something that should've been included in the maker in the first place :)

Edited by Chantal

Share this post


Link to post
Share on other sites

Very cool script. If you are doing compatibility requests, I would love if it worked with KMS's Generic Gauge as well (which is compatible with Yanfly's Status menus through a compatibility patch.) Found here:

 

http://forums.rpgmakerweb.com/index.php?/topic/1934-kms-generic-gauge/

 

One thing to note is that KMS's gauges are larger, so a third exp bar would not fit on the status menu (perhaps just make it not appear on the status menu since there's already exp bars there.) Either way, good job with the script!

Share this post


Link to post
Share on other sites

nice lil update. I noticed that the exp gauge was getting cut off in the skills menu and class changing menu of YEA Class System, which I use. So a little shifting things up was quite easy

Share this post


Link to post
Share on other sites

 

Changing the color of the gauge doesn't seem to work :(

It does for me, I have tried pasting it in new game and all current existing games. Do you have any other scripts that may be conflicting with it? also here is the color references http://www.rpgmakervxace.net/topic/4001-text-color-quick-reference/

bah I didn't try it in a new game, was being lazy >.< it must be conflicting with another script. It's alright though, nothing wrong with the default.

Share this post


Link to post
Share on other sites

Thanks a ton, this is the exact thing I needed. However, if you don't mind, I made a slight modification to the script to get it to suit my needs a bit better.

s6xF4Xw.png

As you can see, I changed the color to match the exp bar on Yanfly's victory script, and moved it over to that empty space under the level.

Obviously this won't work for all setups, but I think it looks a bit more space efficient than having three bars stacked on top of each other next to empty space.

Here's the modified script so nobody gets mad at me for keeping it to myself or something

 

#----------------------------------------------------------------------------

# EXP gauges by Rbahamut, very slightly tweaked by Firecat1311 (VERY slightly)
#----------------------------------------------------------------------------
# v1.4
#----------------------------------------------------------------------------
# Changes in 1.4 - EXP Gauges now work properly passed level 2! (There was a
# problem with the gauge not filling all the way past level 2)
# Changes in v1.3 - Adjusted ui to fit gauges properly in "Skills" window and
# other variations of the same window such as YEA Class changing window, etc
# Changes in v1.2 - Added another customizing capability of changing the
# gauge back color when empty!
# Changes in v1.1 - No more exp clearing on leveling!
#----------------------------------------------------------------------------
# RGSS3 only Plug n Play
#----------------------------------------------------------------------------
#*This script will add exp gauges to both the menu status and status windows
#----------------------------------------------------------------------------
# Edit below at own risk!
#----------------------------------------------------------------------------


class Window_Base < Window
#--------------------------------------------------------------------------
# * Get Text Colors
#--------------------------------------------------------------------------

def exp_gauge_color1; text_color(12); end; # EXP gauge added lower half
def exp_gauge_color2; text_color(4); end; # EXP gauge added upper half
def exp_gauge_back_color; text_color(19); end; # EXP Gauge background

#--------------------------------------------------------------------------
# * Draw exp Gauge
# rate : Rate (full at 1.0)
# color1 : Left side gradation
# color2 : Right side gradation
#--------------------------------------------------------------------------
def draw_expgauge(x, y, width, rate, color1, color2)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x, gauge_y, width, 6, exp_gauge_back_color)
contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
end
#--------------------------------------------------------------------------
# * Draw EXP This is the exp info to be drawn on the "menu" status
#--------------------------------------------------------------------------
def draw_exp(actor, x, y, width = 112)
x += 5
s1 = actor.max_level? ? "---------" : actor.exp
s2 = actor.max_level? ? "0" : actor.next_level_exp - actor.exp
if actor.max_level? ?
draw_expgauge(x, y-1, width, 1, exp_gauge_color1, exp_gauge_color2) :
draw_gauge(x, y-1,width,((((actor.exp - actor.current_level_exp).to_f/100) / ((actor.next_level_exp.to_f - actor.current_level_exp.to_f)/100))),
exp_gauge_color1, exp_gauge_color2)
end
change_color(system_color)
draw_text(x, y-1, 60, line_height, "Next")
change_color(normal_color)
if actor.max_level? ?
draw_text(x + width - 72, y-1, 72, line_height, "------------", 2) :
draw_text(x + width - 72, y-1, 72, line_height, actor.next_level_exp.to_i - actor.exp.to_i, 2)
end
end
#--------------------------------------------------------------------------
# * Draw Simple Status
#--------------------------------------------------------------------------
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x, y + line_height * -0.3)
draw_actor_level(actor, x, y + line_height * 0.7)
draw_actor_icons(actor, x, y + line_height * 1.7)
draw_actor_class(actor, x + 120, y + line_height * -0.3)
draw_actor_hp(actor, x + 120, y + line_height * 0.7)
draw_actor_mp(actor, x + 120, y + line_height * 1.7)
draw_exp(actor, x + 120 -124, y-2 -21 + line_height * 2.7) #<== This line adds the exp gauge to "menu" status
end
end

class Window_Status < Window_Selectable
#--------------------------------------------------------------------------
# * Draw New Experience Information This is the exp info to be drawn in the "status" window
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-------" : @actor.exp
s2 = @actor.max_level? ? "0" : @actor.next_level_exp - @actor.exp
if @actor.max_level? ?
draw_gauge(x, y + line_height * 3, 130, 1, exp_gauge_color1, exp_gauge_color2) :
draw_gauge(x, y + line_height * 3, 130,((((@actor.exp - @actor.current_level_exp).to_f/100) / ((@actor.next_level_exp.to_f - @actor.current_level_exp.to_f)/100))),
exp_gauge_color1, exp_gauge_color2)
end
s_next = sprintf(Vocab::ExpNext, Vocab::level)
change_color(system_color)
draw_text(x, y + line_height * 3, 30, line_height, "EXP")
draw_text(x, y + line_height * 2, 180, line_height, s_next)
change_color(normal_color)
draw_text(255, y + line_height * 3, 180, line_height, s2, 2)
if @actor.max_level? ?
draw_text(x + width - 72, y, 72, line_height, "------------", 2) :
draw_text(x + width - 72, y, 72, line_height, @actor.next_level_exp.to_i - @actor.exp.to_i, 2)
end
end
end

 

Share this post


Link to post
Share on other sites

Is there any way to change the value on the Exp Bar to read RELATIVE experience and not TOTAL? The bar itself fills as you progress from the level you're currently on to the next but the numerical readout just shows the total experience needed to get to the next level (counting previous levels too). Any chance you can get it to read the amount needed to get to the next level only.

 

Thanks.

Edited by pparke2

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×