MV Conditions for obtaining skill on level up

There are a couple of skills I want a character to obtain on level up, but not before a specific event flag has been hit. A possible workaround is making an exact copy of their class with the new skills added that they switch to when that flag is hit, but for balancing and development purposes it would be useful to set other conditions, like having skills locked behind multiple different event flags or having actors of the same base class learn skills at different levels, without having a bunch of redundant classes that constantly need to be deleted and updated every time the base class is changed.
Base code:
JavaScript:
Game_Actor.prototype.levelUp = function() {
    this._level++;
    for (const learning of this.currentClass().learnings) {
        if (learning.level === this._level) {
            this.learnSkill(learning.skillId);
        }
    }
};

Edited code:
JavaScript:
(() => {
let conditionalSkillId = [] //Put all the skills you want to check a switch for here

Game_Actor.prototype.levelUp = function() {
    this._level++;
    for (const learning of this.currentClass().learnings) {
        let skillId = learning.skillId;
        if (conditionalSkillId.include(skillId) && !this.isLearnedSkill(skillId) && learning.level <= this._level) {
            switch (skillId) {
                case 1: //Replace 1 with the first skill id in the conditionalSkillId array
                    if ($gameSwitches.value(switchId)) this.learnSkill(skillId); //replace switchId with the switch you want to check for
                    break;
                case 2: //Copy and paste case 1 if you want more conditional skills otherwise delete case 2
            }
        }
        else if (learning.level === this._level) {
            this.learnSkill(skillId);
        }
    }
};
})();
Your game, but I can't see where making learnable skills be missable and tied to conditions at level-up is good design.
Unless you can reduce levels by choice...

Again, your game...
Your game, but I can't see where making learnable skills be missable and tied to conditions at level-up is good design.
Unless you can reduce levels by choice...

Again, your game...
The idea isn't to have them missable, but to to delay them getting the skill until both the level requirement and the story requirement have been fulfilled. Think obtaining an artifact or a familiar that contributes to their moveset, but expands it as they level up instead of all at once. It wouldn't make sense for them to have skills that shouldn't be possible before a particular story or character beat happens, but it's not possible to guaruntee the player won't hit the level requirement early.
I haven't tested the code yet, but I think that's as easy as including an "add skill" line at the event flag itself.

The other main reason I was looking into conditions is I have movesets tied to specific actors rather than classes, but at far as I know only classes learn skills with level progression. For the purpose of balancing the game I currently have every character using the same class, so I can easily adjust the general growth curves and add nuance to their builds by giving the individual actors parameters like "Attack 110%" "Defence 90%"
As a side effect, every single character learns every other characters' skills when they level up. For now I just have each skill tied to an actor's weapon type, but they still appear faded out in menus which will get more cluttered as development continues. Now that I'm starting to have people test the game it would be nice to clear up some confusion by restricting skills to their respective actors, and if I don't have to make a bunch of redundent classes right before the game ships all the better. This also means more flexibility in general, like two different characters learn the same skill but at different levels.
It wouldn't make sense for them to have skills that shouldn't be possible before a particular story or character beat happens, but it's not possible to guaruntee the player won't hit the level requirement early.
instead of adding the character specific skills to the class, you can give the actors all the traits for the skills that theyll learn this way and then use a plugin like yanfly's skill core to hide the skills until the story and level requirement is met

For the purpose of balancing the game I currently have every character using the same class, so I can easily adjust the general growth curves and add nuance to their builds by giving the individual actors parameters like "Attack 110%" "Defence 90%"
the same also applies to the classes. you can give each actor their own class and make them all have the same stat curve but put extra param traits on the actor OR the class. or even customize each class's parameter curves individually using your base class as the base line.

Now that I'm starting to have people test the game it would be nice to clear up some confusion by restricting skills to their respective actors, and if I don't have to make a bunch of redundent classes right before the game ships all the better. This also means more flexibility in general, like two different characters learn the same skill but at different levels.
As long as your actors cant use eachothers' classes, separate classes will restrict skills to their respective actors. The classes wouldnt be redundant if theyre actually learning different skills and get skills at different levels. Ultimately its up to you, but IMO the option that provides the most flexibility is giving each actor their own class
The other main reason I was looking into conditions is I have movesets tied to specific actors rather than classes, but at far as I know only classes learn skills with level progression. For the purpose of balancing the game I currently have every character using the same class, so I can easily adjust the general growth curves and add nuance to their builds by giving the individual actors parameters like "Attack 110%" "Defence 90%"
As a side effect, every single character learns every other characters' skills when they level up. For now I just have each skill tied to an actor's weapon type, but they still appear faded out in menus which will get more cluttered as development continues. Now that I'm starting to have people test the game it would be nice to clear up some confusion by restricting skills to their respective actors, and if I don't have to make a bunch of redundent classes right before the game ships all the better. This also means more flexibility in general, like two different characters learn the same skill but at different levels.
No offense, but what you're doing doesn't sound that smart or flexible. Having several classes specifically made for each character is the cleanest way to organize all their stats and skills and I don't see how that would be considered as "redundant classes". It makes it extremely easy to tell which skill belongs to who in the long run if you're planning to have up to a dozen unique actors each with their own set of unique skills. Especially if you intend for each character to be distinct from each other. In addition, having all the skills greyed out makes for bad QoL as most players will assume that character will be able to use it someway or another.

What you're doing is stacking up "technical debt." You're avoiding sorting out your skills and classes right now only to inevitable have to deal with the confusion of having dozens of learnable skills in a single class. AND THEN you'd have to individually sort them out later after tying in movesets with specific actors, this was literally what classes were made for, to sort skills and traits to actors.

There's literally dozens of methods in the RPG Maker code that seems redundant like "this.hasNoWeapons()" when "this.weapons().length === 0" does the exact same thing. But it's extremely clean and reusable code that you might often revisit. And what's one of the things you're gonna revisit the most in game developing? The database. Clean and readable are the industry standard for a reason (unless you're using Unreal Engine 5) so do yourself a favor and take my advice seriously. If you ever plan on working with other people stuff like this either needs to be recorded in a excel spreadsheet or prematurely sorted out before it becomes a problem.

P.S.

This is just my opinion from here on out. But giving all your characters the same class for balancing issues sounds like bad game design. It makes all the characters mesh together and nonmemorable gameplaywise and I don't know a single game that does that without giving the player extreme freedom in build creation. And giving your characters a slight stat increase/decrease isn't enough to give them nuance. That's like those bad monkey NFTs that pretended they were creative by giving them different costumes each time. You don't need extreme game balance to be fun, games that are well polished but with a little jank to them are a lot of fun, like Cruelty Squad, Fear and Hunger: Termina, or Hollow Knight: Silksong (difficulty is cranked to 11). Literally just add a glass canon to your roster, it will 9/10 times make your game more engaging.

Edit: I figured my comparisons of games was a little unfair since those games have a lot more to offer than just gameplay.
instead of adding the character specific skills to the class, you can give the actors all the traits for the skills that theyll learn this way and then use a plugin like yanfly's skill core to hide the skills until the story and level requirement is met


the same also applies to the classes. you can give each actor their own class and make them all have the same stat curve but put extra param traits on the actor OR the class. or even customize each class's parameter curves individually using your base class as the base line.


As long as your actors cant use eachothers' classes, separate classes will restrict skills to their respective actors. The classes wouldnt be redundant if theyre actually learning different skills and get skills at different levels. Ultimately its up to you, but IMO the option that provides the most flexibility is giving each actor their own class
1. I tried using the hide function before posting the thread, turns out I made a mistake with the notetag so that's working now. The one drawback here is that the character will still get the "X learned Y!" notice on level up and then confuse the player when it's not in their actual skill list, but I imagine I can use the code from LowrellLovelace to just hide the notification.
2. This is a fair point, but the main reason I'm using the base class for parameter curves is if I edit the base classes' growths I either have to manually edit all the other classes, or copy the base curve and manually add all the individual classes' traits and skills. I could look for a plugin that allows the other classes to inherit the param curves from the base class.

To reiterate, I'm not necessarily planning on using only one base class in the final game, but while I'm in the early stages of actively balancing and making frequent significant changes to the parameter curves it keeps the characters' growth consistent relative to each other. If I need to make a quick adjustment to how quickly the party's maxhp scales, I don't need to generate three separate curves for the glass cannon, the all-rounder and the tank when they scale relative to each other. Again, each actor has a tailored moveset of skills and mechanics that are unique to them, it's about figuring out how to scale their growth relative to each other. Part of the point of making the thread was to figure out and weigh the options that were out there.

Original thread: https://forums.rpgmakerweb.com/threads/conditions-for-obtaining-skill-on-level-up.182628/