Help with class change system

Hey folks,

I'm trying to create a class change system where the user can change their class anywhere, anytime. So far, I have created an item that will call a common event to give you a choice among all the current members of your party (using text to display \P[n], so that it displays all your current party member's names as choices)

This part works fine. What I need help with is for the event to be able to tell WHICH name was selected. Since variables are only numeric, and there is no conditional branch to help with what \P[n] is, is there some sort of script I could use that would be able to say something like:

If \P[1] = Bob, then do this

this would save me MANY troubles, because if there's no solution then I imagine I'll have to create a million conditional branches for "if so and so" is in party and all the possible combinations

any help appreciated 🙂
Have you considered scripts?
 

https://yanflychannel.wordpress.com/rmvxa/core-scripts/class-system/ comes to mind.
What I need help with is for the event to be able to tell WHICH name was selected. Since variables are only numeric, and there is no conditional branch to help with what \P[n] is, is there some sort of script I could use that would be able to say something like:


If \P[1] = Bob, then do this
Didn't you use the show choices command for the selection? If you did, then there is no need for additional condition checks, you'll be already in the selected branch, and you'll know up front what was selected there.
If you still have problems, please post a screenshot of your events so that we can see what you have done and how it can be corrected.
The event calls \P[1]'s name (We'll say its Bob) but there's no conditional branch that allows me to set conditions on what \P[n] is

the game has 5 main playable characters. And, of course, party formation can change (though still pretty irrelevant to this problem)

So like, the event goes like

Show choices

        If \P[1]

        If \P[2]

So it displays each character's name, I'm just wondering if there is a way to set a conditional branch on what \P[n] is.

EDIT: Nevermind, I found a much easier way to solve the problem: 

- Have a key item be the source of Class Change command.

- Upon use on one ally, have it inflict a state onto the character "classchange"

- Immediately call on an event that has conditional branches for each character having the "class change" state

- When done heal the state off all characters

Thanks for the help folks!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-class-change-system.38575/