class level

How would I go about finding a classes level without changing to that class?

In other words if the actor were to change classes how would I be able to find what level the previous class is. I know in $game_actor the classes and they're exp are stored in @exp but I'm not sure how to check the level without changing back.
Take a look at the Game_Actor.change_exp method (called from Game_Actor.change_class).


It just repeatedly does a level up or level down from the actor's current level until the current exp is within the range for that level. There are a couple of other methods called by it that should help to shed some light.
It did already. I have already used and altered those methods in the past. I just never crossed my mind. Thanks again Shaz!


Edit**
Figured it out. Thanks agian Shaz.
For anyone who is interested, throw this into a $game_actor class.

I lied it is still only showing the current classes level.

Figured it out.

 

Code:
  #--------------------------------------------------------------------------  # * Returns Class Level  #--------------------------------------------------------------------------  def class_level(class_id)    xp = @exp[class_id]    lv = 1    lv += 1 while !max_level? && xp >= $data_classes[class_id].exp_for_level(lv + 1)    lv -= 1 while xp < $data_classes[class_id].exp_for_level(lv)    return level  end
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/class-level.19858/