Soft level cap and conditional variable?

Halnalta

Warper
Member
Joined
Sep 7, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm looking for a way to limit the level of the players initial class down to a certain number and then once they hit that cap, say 40 or 50, they can revisit the class trainer and choose another class to upgrade into. I need to be able to have the game detect that the character has reached that point AND a way to stop them from leveling up after hitting the soft cap.
 

Rugman

Veteran
Veteran
Joined
Jun 11, 2020
Messages
145
Reaction score
37
First Language
English
Primarily Uses
RMMV
Just set your exp to stop at level 50 and make event that turns on a switch at that level to activate your trainer npc.
 

Halnalta

Warper
Member
Joined
Sep 7, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
Just set your exp to stop at level 50 and make event that turns on a switch at that level to activate your trainer npc.
Right, I can understand that, just don't know the how exactly.
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
I need to be able to have the game detect that the character has reached that point
If you only need to check if your character has reached a certain level to determine the response of your class trainer, you can do that using a variable and a conditional branch:

@>Control Variables: [0020:Current Level] = [Eric]'s Level
@>Conditional Branch: Variable [0020:Current Level] >= 40
...
@>Else
...
@>Branch End


If you want an event to trigger the moment your character reaches level 40 without any additional input, you could run a common event every time the character gets experience to check their level (you can run a common event right after a battle by activating a switch at the start of the fight through a troop event, and have a parallel common event after the battle that is activated by that switch).

...AND a way to stop them from leveling up after hitting the soft cap
By default the game is coded so characters have a static maximum level.
You could try to replace your old character with a clone that has a higher maximum level or stripping any extra experience though a common event, but the easiest way would probably to use a small plugin to allow you to change the maximum level during the game:

Code:
/*
* @plugindesc Change an actors maximum level
* @help Change an actors maximum level using this script command:
*
*   $gameActors.actor( ID ).setMaxLevel( MAX );
*
* ID : Actors Database ID
* MAX : New Maximum Level or 0 to return to the database value.
*/

Game_Actor.prototype.setMaxLevel = function(newMaximum) {
    this._maxLevel = newMaximum;
    this.changeExp(this.currentExp());
};

Game_Actor.prototype.maxLevel = function() {
    return this._maxLevel || this.actor().maxLevel;
};
Edit: Code corrected...

Imported as a plugin this code should allow you to use
$gameActors.actor(15).setMaxLevel(95);
in a script command to change actor #15's maximum level to 95.


Hope this helps.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,097
Members
137,588
Latest member
_Coby_
Top