Draw status Exp as 0/100

Hello I'm looking for a short script that draws exp as 0/50, and when I reach the max exp it will draw max exp.

in the form of this:


def draw_exp_info(x, y)
s1 = @actor.max_level? ? "MAX EXP" : @actor.exp
s2 = @actor.max_level? ? "MAX EXP" : @actor.next_level_exp - @actor.exp
s_next = sprintf(Vocab::ExpNext, Vocab::level)
change_color(system_color)
draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal) #EXP WORD
draw_text(x, y - 20 + line_height * 2, 180, line_height, s_next) #NEXT EXP WORD
change_color(normal_color)
draw_text(x - 110, y - 10 + line_height * 1, 180, line_height, s1, 2) #EXP NUMBER

draw_text(x - 110, y - 30 + line_height * 3, 180, line_height, s2, 2) #NEXT EXP NUMBER
end
I want it to be under the same method. So I want to be able to add it back into the main script and use it, and instead of it displaying as

current exp

0

to next exp

50

it will say 0/50

thanks in advance!

I basically took it from the status window, and added it to another script. it's working but I want it to look cleaner.
You can use the method "draw_current_and_max_values(x, y, width, current, max, color1, color2)"

And if you for example hit level 2, lets say from level 2 to level 3 you need 100 exp in total. so how would it look like?:

0/100 or: 50/150 ?

For the second one you can use this for example:

def draw_exp_info(x, y) s1 = @actor.max_level? ? "-------" : @actor.exp s2 = @actor.max_level? ? "-------" : @actor.next_level_exp draw_current_and_max_values(x, y, 100, s1, s2, normal_color, normal_color) endIf you want it displayed like I mentioned first you need to do some math.
This will draw that stuff plus a gauge (one liners FTW!).

def draw_exp_info(x, y)  unless @actor.max_level?    s1 = @actor.current_level_exp    r1, r2 = (@actor.exp-s1), (@actor.next_level_exp-s1)    actualPerc = r1*100/r2    #You can draw an EXP bar    draw_gauge(x, y, 120, actualPerc/100.0, text_color(20), text_color(21))    #And draw your data    draw_text(x, y, 120, line_height, actualPerc.to_s+" / 100",1)  else    contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)    draw_text(x, y, 120, line_height, "MAX LEVEL",1)  endend
Salut,

OZ
Thanks guys this will do just fine!

Original thread: https://forums.rpgmakerweb.com/threads/draw-status-exp-as-0-100.18376/