New account registration is temporarily disabled.

[RMMZ] CLASS LEVELS/LEVEL-UP DISPLAY

Posts

Pages: 1
Currently making a game that utilizes Main Classes and Subclasses...
It isn't TOO big of an issue, but it slightly bothers me that upon completing a battle, you only see the "Level Up!" screen if the main class levels up. However, when the subclass levels up, it is not shown on the level up screen. Instead, you have to manually check the "Class Menu" to see if it has levelled up.
Is there any way to change that so the level-up screen is shown if ANY class levels up?
Also, is there a way to reduce a class's Maximum Level?
Marrend
Guardian of the Description Thread
21806
How to go about doing that might depend on how subclasses are possible to begin with. For what it's worth, the built-in function that is called when a character gains expereince is probably...

Game_Actor.prototype.changeExp = function(exp, show) {
    this._exp[this._classId] = Math.max(exp, 0);
    const lastLevel = this._level;
    const lastSkills = this.skills();
    while (!this.isMaxLevel() && this.currentExp() >= this.nextLevelExp()) {
        this.levelUp();
    }
    while (this.currentExp() < this.currentLevelExp()) {
        this.levelDown();
    }
    if (show && this._level > lastLevel) {
        this.displayLevelUp(this.findNewSkills(lastSkills));
    }
    this.refresh();
};

...this one. It kinda looks like...

if (show && this._level > lastLevel) {
  this.displayLevelUp(this.findNewSkills(lastSkills));
}

...this is the part of that function that you want to switch up to detect what subclasses are leveling up in regards to displaying the level up message.

*Edit: On second thought, after re-reading the code, the expression...
this._exp[this._classId] = Math.max(exp, 0);
...would likely only read the "main" class to begin with.

Which seems to suggest the code could be used kinda as-is, if it could loop within the main class plus subclasses. If the main class and subclasses were an array, it could be looped with...
this._exp[this._classID[i]]
...this expression, or something like that. However, without knowing how these things look, I can go no further.
Pages: 1