A character learning 1 of 2 skills after a level up

So, I'm wondering how i can make a system were on certain level ups, a player can choose 1 of 2 skills to learn. Kind of as a way for a player to customize their character

I'd like to try to do this with events. So, is there a way to tie a common event to a level up? I'm thinking it could be done in evented enemies somehow, maybe by increasing a variable by the amount of exp the event gave, but then how to know for each character?
I guess maybe by setting another variable to the amount of EXP a character needs to reach that milestone and subtracting the EXP gained variable from each one and when it gets to zero reset it and call a common event?

Never mind, I figured it out by typing this
Probably what would be easier than manually tracking EXP amounts or whatever would be simply testing whether or not the character leveled up. Something like this:

Code:
// This is just pseudocode that can be translated into event commands

var currentLevel = [level of character]

if (currentLevel > oldLevel)
{
    oldLevel = currentLevel
    // Player has leveled, so do your skill choosing stuff here
}

Unless I'm misunderstanding your intentions, I don't see a benefit to trying to track actual exp needed per level and stuff. Just check your current level, check whether or not it's the same as it was last time, and if not, then you know that you leveled.
Code:
// This is just pseudocode that can be translated into event commands

var currentLevel = [level of character]

if (currentLevel > oldLevel)
{
    oldLevel = currentLevel
    // Player has leveled, so do your skill choosing stuff here
}
Thanks. I want to minimize the number of scripts I'm using so they don't argue with each other causing problems. Using this, it would make it a bit easier
Thanks. I want to minimize the number of scripts I'm using so they don't argue with each other causing problems. Using this, it would make it a bit easier
No problem, but for some reason, my ADHD brain randomly thought about this situation again today... and I realized that the advice that I gave you could have a potential flaw.

If there is any possibility that a character might gain more than one level from a single battle (like say that a new character joins your party and starts off relatively low level and then you bring them into a fight that yields enough exp to gain them multiple levels in one go), then the method that I described wouldn't work right. Then they'd only gain one skill, even though they leveled multiple times.

Unless you're 300% positive that there is no chance that could ever happen, I'd recommend tweaking my algorithm a bit. Here's a safer version compared to what I recommended the other day:

Code:
// This is just pseudocode that can be translated into event commands

var currentLevel = [level of character]

if (currentLevel > oldLevel)
{
    var levelsGained = currentLevel - oldLevel
    oldLevel = currentLevel
    
    Loop levelsGained times
    {
        // Player has leveled, let them choose a skill
    }
}
thank you again!

Original thread: https://forums.rpgmakerweb.com/threads/a-character-learning-1-of-2-skills-after-a-level-up.144298/