''To Next Level'' to a variable

Hello!
I saw that it´s possible to store the current EXP of the actor in a variable. But I would like to know if it´s possible to store somehow
the "to next level" value to a variable.
to next level.jpg


Thank you very much in advance!
You can use the "nextRequiredExp" function:
https://kinoar.github.io/rmmv-doc-web/classes/game_actor.html#nextrequiredexp
Hello @Aloe Guvner!
Thank you again for help me haha!!

I'm sorry, I tried everything:

DataManager.nextRequiredExp(Game_Actor[1])
Game_Actor[1].nextRequiredExp()
Game_Actor[1].nextRequiredExp(1)
nextRequiredExp().Game_Actor[1]
nextRequiredExp(Game_Actor[1])
Game_Actor.nextRequiredExp(1)

but none of them worked out xD

I have read your explanation here https://forums.rpgmakerweb.com/index.php?threads/save-file-05-conditional-branch.107238/ but
I couldn't find a solution. I'm very bad with codes xD

Sorry about that haha
Please, could you help me on this?
Code:
$gameActors.actor(1).nextRequiredExp()
@Trihan Thank you very much! It Works perfectly!

I would like to ask another question. How do I increase the exp of a member.

I mean, have stored sucessfuly the "to next level" of member 1 to a variable using $gameParty.members()[1].nextRequiredExp();

Now I don´t know how to increase the member 1 exp using this variable.

Could you guys help me please?
Thank you in advance!
Code:
If you want to add exp to actor 1 equal to the amount they need for the next level, you could do something like this:

actor = $gameActors.actor(1);
nextLevel = actor.nextRequiredExp();
actor.gainExp(nextLevel);
@Trihan hello!
Unfortunately that way it will not work for me. In my gameI have about 16 actors, and the player can switch between then all the time. That´s why I need the $gameParty.members()[1].

This is what I´m doing
pet exp test.jpg



It´s kind of a item, then if you use this item, you will gain 10% of the "nextrequiredexp".

In the actor 1 case it works perfectly because the system already let me put a variable as a operand:

actor exp test.jpg

variable operand.jpg



I need to do exactly as the image above, but, instead of select an actor, I will put the $gameParty.members()[1].


I hope I could explain myself well xD

Thank you very much in advance for your help.

EDIT:

Woaahh!!! I could do it xDD

When I did the explanation I ended up having an idea haha.

​
View attachment 113069

I set a variable as a party member, then I did exactly what I told you I was needing to do xD
and it works haha
​

But I would not have been able to do it without the help you gave me $gameActors.actor(1).nextRequiredExp().

Thank you very much!
​
Code:
actor = $gameParty.leader();
expValue = Math.round(actor.nextRequiredExp() / 10);
actor.gainExp(expValue);
Thank you @Trihan for your help! :LZScheeze:

Original thread: https://forums.rpgmakerweb.com/threads/to-next-level-to-a-variable.107724/