Class change option: Keep Level

By default, when you change the class of a character with an event command, it don't keep the exp gained with that classe.  This happens because each class have it's own experience.


For example. A level 20 Fighter with 45.000 EXP that change it's class to Mage will become a level 1 Mage with 0 experience. Returning to Figther will make the actor return to 45.000 EXP.


Nothing wrong with that, but it would be nice if there was an option to keep the experience when you change class. So a level 20 fighter with 45.000 exp will become a Mage with 45.000 exp (and if the exp table is the same, woult be at same level).


This options i already avaiable on the code.


Game_Actor.prototype.changeClass = function(classId, keepExp) {
if (keepExp) {
this._exp[classId] = this.currentExp();
}
this._classId = classId;
this.changeExp(this._exp[this._classId] || 0, false);
this.refresh();
};


The argument 'keepExp', if set to true, allows the actor to keep the exp he have gained.


But the event command for changing class is always false:


Game_Interpreter.prototype.command321 = function() {
var actor = $gameActors.actor(this._params[0]);
if (actor && $dataClasses[this._params[1]]) {
actor.changeClass(this._params[1], false);
}
return true;
};


So all that would be needed is to add a parameter for that in the change class window (just a check box with "keep experience"  is enough) and make the changeClass call to use this parameter.
We'll look into it.

Original thread: https://forums.rpgmakerweb.com/threads/class-change-option-keep-level.55765/