[SOLVED] (Tks to Sacred Nym) [RMVX] Get current EXP and MaxEXP for this level

Started by askiplop, June 15, 2010, 06:05:24 pm

Previous topic - Next topic

askiplop

Hello!

It's me, again!

I wonder how to get the crrent EXP and the MaxEXP for the current level for actor 1, because i want to show a bar on the screen with the % of the EXP for the next level.

In the Control Variables window, i only get the current EXP points.

Is it possible?

Many thanks for any help!

Have a nice day!
Askiplop

Thanks?

Sacred Nym

First, throw this little snippet into your script editor under Materials.

class Game_Actor
  def next_exp_i
    return @exp_list[@level+1]
  end
  def next_rest_exp_i
    return (@exp_list[@level+1] - @exp)
  end
end


Then you can use one of two call scripts:

$game_variables[VARIABLE_ID] =
$game_actors[ACTOR_ID].next_exp_i


Which will store the TOTAL experience the actor needs for the next level (from 0 EXP). Or...

$game_variables[VARIABLE_ID] =
$game_actors[ACTOR_ID].next_rest_exp_i


which will store the amount the actor still needs before level up.
Quote昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

askiplop

Thank you VERY much for your help Sacred Nym, i'll try it in a couple of minutes ;)