*Solved* Disable Level Down With Lowering EXP

I will attempt to explain this as clearly as I can as it might be a bit confusing as this isn't something I have seen asked on here much (if at all).

My game treats EXP and gold as the same thing, it is your experience and your currency, and on death, I have a common event that sends you back to the main hub and you lose all your EXP and your gold which means your progress to the next level and your currency are depleted as punishment for dying.

The issue I am having is I don't know how to set my event to only remove enough EXP to reset progress to the next level depending on how much EXP the player has, so I set it to remove 999999 EXP on death which works fine, except it resets the player to level 1.

Is there a way I can disable levels being lowered, so that the player can't abuse the system to get stats point very quickly and at a high amount by defeating enemies that give lots of EXP since they keep their stats that they levelled up? Or a variable I can set that only removes the exact EXP to the next level?

My game uses SRD stat distribution for reference. If you need to know what other plugins I am using just ask I will provide you with whatever you need to know. Have a good one.
well... I don't know the script call about this
but I would suggest you better do your exp as variable instead
like when you get exp you store it in variable
then when you lose it you just decrease variable
or when you spend it you use increase exp
I just checked.
To accurately decrease EXP to right before actor get level down (0% before level up), you have to substract the actor current EXP with the actor current level EXP (EXP requirement of actor current level) which are different for each classes since they have their own exp curve. So you have to deal with each actor manually.

Here's the command :
1586242262583.png

Or a convenient one liner :
1586242440392.png

$gameActors.actor(ID).currentExp() - $gameActors.actor(ID).currentLevelExp()
I just checked.
To accurately decrease EXP to right before actor get level down (0% before level up), you have to substract the actor current EXP with the actor current level EXP (EXP requirement of actor current level) which are different for each classes since they have their own exp curve. So you have to deal with each actor manually.

Here's the command :
View attachment 138987
Or a convenient one liner :
View attachment 138988
$gameActors.actor(ID).currentExp() - $gameActors.actor(ID).currentLevelExp()
Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/solved-disable-level-down-with-lowering-exp.119905/