Subclass Conditional Branch Item

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hi everyone,

So I'm using RPG Maker MV and both Yanfly's Class Core and Subclass plugins. I don't want players to be able to change classes from a menu and am only allowing players to ever gain one subclass. There are only three primary classes in the game so I tried creating an item (Wiz'Ma Rune) that would allow someone with the primary class of Mage to become the subclass wizard.

First I created a temporary state to apply to a mage on use (wizard state).

Then I set the item to call a common event (Learn Wizard).

Within the common event I set conditional branches to check if the state was applied to each mage in my game. I also set it to check if the subclass of the mage was peasant. If it was I used the plugin command to change the character's subclass from peasant to wizard. I think this is where I set myself up for failure. At first this worked but you were able to use the item on a mage that already had a subclass and that's when I added the peasant class. I also tried using yanfly's subclass restriction note tags on the item instead but it wouldn't work 100% of the time. So I tried a work around using more conditional branches.

I set the branches to check for the state, then check for each subclass including Peasant. Each subclass other than peasant has a message displayed that you already have a subclass. The peasant branch should just alter your subclass, remove the wizard state, and remove one Wiz'ma Rune. So far I am only using If branches and this is the first time I've used so many conditional branches at once. Should I use else branches also? Am I even using the If branches correct? Maybe someone can help me with the note tags instead? Any help will greatly be appreciated!
 

Attachments

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
Try moving your Peasant IF directly under the first IF. Then nest the remaining IF statements under Pleasant If / Else.

If the state is active it first checks to see if the actor is a peasant. If so, they are changed to a wizard. The Else then moves to check the other classes.

To me it seems working on the order of how the checks are done should fix your event.

Code:
If : Lanyard is affected by wizard state
<>If : Class of Lanyard is Peasant
<><>Else:
<><><>If : Class of Lanyard is Blood Mage
<><><>If : Class of Lanyard is Wizard, etc...
Hope that gets you a little closer.
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Thank you, I'll give this a try and let you know how it works out.
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
So I gave it a try, It didn't work. It lets me target the character and use the item, it even plays the chime when the item is activated. It just doesn't do anything. I believe I have everything in the event set up how you suggested. Any other ideas?
 

Attachments

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
This is an example of an event I built. It took me a while to get the proper order of things for it to work correctly.

A quick break down: Speak to father, speak to all 3 class masters, make class selection, get letter of intent, return to specific class master, complete their quest, return to father for congratulations.

◆Comment:Rewrite of intro quest.
◆If:Class of Player One is Curate
◆Text:npc_samritwald_face1(3), Window, Bottom
: :We have a new curate!
: :Make us proud!
◆Control Self Switch:A = ON

:Else
◆If:Class of Player One is Provisioner
◆Text:npc_samritwald_face1(3), Window, Bottom
: :We have a new provisioner!
: :Make us proud!
◆Control Self Switch:A = ON

:Else
◆If:Class of Player One is Soldier
◆Text:npc_samritwald_face1(3), Window, Bottom
: :We have a new soldier!
: :Make us proud!
◆Control Self Switch:A = ON

:Else
◆If:father_spoken ≥ 3
◆If:Party has Curate's Letter
◆Text:npc_samritwald_face1(3), Window, Bottom
: :You already have your Letter
: :of Recommendation. Please see
: :Father Maxwell Ritwald at
: :The Ritwald Gospel.

:Else
◆If:Party has Provisioner's Letter
◆Text:npc_samritwald_face1(3), Window, Bottom
: :You already have your Letter
: :of Recommendation. Please see
: :Reginald Bon'Claire at
: :The Merchant Guild.

:Else
◆If:Party has Soldier's Letter
◆Text:npc_samritwald_face1(3), Window, Bottom
: :You already have your Letter
: :of Recommendation. Please see
: :Kell, Master at Arms at
: :Ritwald Guard Captain House.

:Else
◆Text:npc_samritwald_face1(3), Window, Bottom
: :I see you have spoken to all 3
: :trainers. Please choose who you
: :wish to join.
◆Show Choices:The Clergy, The Merchant Guild, The Town Guard, Undecided (Window, Right, #1, #2)
:When The Clergy
◆Text:npc_samritwald_face1(3), Window, Bottom
: :A life based on faith. Father Maxwell
: :will guide you on your holy journey.
: :Heed his words well. They will serve
: :as guidance.
◆Change Items:Letter of Intent - 1
◆Change Items:Curate's Letter + 1

:When The Merchant Guild
◆Text:npc_samritwald_face1(3), Window, Bottom
: :My old rival Reginald Bon'Claire.
: :Despite our history I can think of
: :no one else to better train you in
: :the merchant guild.
◆Change Items:Letter of Intent - 1
◆Change Items:Provisioner's Letter + 1

:When The Town Guard
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Kell has been with me since the we
: :first founded the Town of Ritwald.
: :He has trained many a fine soldier.
: :Truly the finest soldier I know.
◆Change Items:Letter of Intent - 1
◆Change Items:Soldier's Letter + 1

:When Undecided
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Still undecided. Speak to me
: :again once you have decided.
◆Change Items:Curate's Letter - 1
◆Change Items:Provisioner's Letter - 1
◆Change Items:Soldier's Letter - 1

:End

:End

:End

:End

:Else
◆If:father_spoken = 2
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Don't return until you have
: :spoken to all three trainers.
: :You have only spoke to two of
: :the trainers.

:Else
◆If:father_spoken = 1
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Don't return until you have
: :spoken to all three trainers.
: :You have only spoke to one of
: :the trainers.

:Else
◆If:Party has Letter of Intent
◆Text:npc_samritwald_face1(3), Window, Bottom
: :You have your Letter of Intent.
: :You still haven't spoken to any
: :of the class masters...

:Else
◆If:father_note is ON
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Good morning. I'm glad to see your
: :awake. I trust you have the note I
: :had your sister put in your room.
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Of course you did or you wouldn't
: :be up this early! I have a Letter
: :of Intent. I want you to visit the
: :three training masters in our town.
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Visit the Town Guard, The Church
: :and of course my old rival at the
: :Merchant Bankers Guild.
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Return to me once you have spoken
: :to all three and have made a decision.
: :I will give you a signed Letter
: :of Recommendation.
◆Text:npc_samritwald_face1(3), Window, Bottom
: :Well off you go, get too it!
◆Control Switches:#0061 father_note = OFF
◆Change Items:Letter of Intent + 1

:Else

:End

:End

:End

:End

:End

:End

:End

:End
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
That's one heck of an event! How were you able to show me the entire thing? I'd like to do the same so everyone can see my whole event, more than just the one actor at the top. I do believe everything is laid out how you suggested though.
 

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
Select all then right click and select copy as text.

I wrote the event using my classes in my project. Take note, each selection is listed under the IF Else for each branch.

◆If:Player One is affected by Test State
◆If:Class of Player One is Commoner
◆Text:None, Window, Bottom
: :Granted New Class Soldier
◆Change Class:Player One, Soldier, true
◆Change State:Player One, - Test State

:Else
◆If:Class of Player One is Soldier
◆Text:None, Window, Bottom
: :You're already a soldier.
: :Go away!

:Else
◆If:Class of Player One is Curate
◆Text:None, Window, Bottom
: :You're a bloody Priest.
: :You're no soldier!

:Else
◆If:Class of Player One is Provisioner
◆Text:None, Window, Bottom
: :They call you Provisioner.
: :I'll call you what you are
: :you stinking thief!

:End

:End

:End

:End

:Else
◆Text:None, Window, Bottom
: :You cannot use this item!

:End


◆Text:None, Window, Bottom
: :Add Test State?
◆Show Choices:Yes, Remove, Set Class (Window, Right, #1, #2)
:When Yes
◆Text:None, Window, Bottom
: :Adding Test State
◆Change State:Player One, + Test State

:When Remove
◆Text:None, Window, Bottom
: :Removing State
◆Change State:Player One, - Test State

:When Set Class
◆Text:None, Window, Bottom
: :Choose your class to test
◆Show Choices:Commoner, Curate, Provisioner, Soldier (Window, Right, #1, #2)
:When Commoner
◆Change Class:Player One, Commoner, true
◆Text:None, Window, Bottom
: :Set to Commoner

:When Curate
◆Change Class:Player One, Curate, true
◆Text:None, Window, Bottom
: :Set to Curate

:When Provisioner
◆Change Class:Player One, Provisioner, true
◆Text:None, Window, Bottom
: :Set to Provisioner

:When Soldier
◆Change Class:Player One, Soldier, true
◆Text:None, Window, Bottom
: :Set to Soldier

:End

:End

You can write one long event or multiple events that are called from one event. You could write one event per character that is called from one event. This might be easier but isn't as efficient if all the events have to be placed as a separate common events.
 
Last edited:

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
I can select all but copy as text is not an option when I right click.

I altered the event again and tested, it still doesn't work but maybe I did something wrong. BTW I just wanted to say thanks for running me through this.

Just seen your edit. I may have to try multiple events called by one event. I'd still like to figure this out just to know how to do it though.
 

Attachments

Last edited:

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
Once all text is selected. Right click and select Copy as Text.

Paste your event then choose the spoiler option so it can be expanded.

One other thing I forgot about. You may need to start a new game. This important so all switches, variables, etc are updating correctly.

I normally start a new game and build the event and a test event that allows me to change everything I need to test. Using an existing save file often causes unforeseen problems.
 

Attachments

Last edited:

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
I can select all the text and right click, copy as text just is not a function it gives me. Take a look at the screen shot below.
 

Attachments

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
Hmm, it might be a new feature part of the 1.6.0 beta.

I see you're using a plugin. This may be why what I am suggesting is not working. I am not sure how the Plugin Command : ChangeSubclass works. Yanfly's Plugins are awesome.

Well off to bed. You can PM me if you like. Have a great evening!
 

Attachments

Last edited:

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Yeah they are all great. The plugin command works fine by it's self. It even worked earlier today until I added the three "Ifs" to prevent a mage with a subclass from sub classing again. Maybe that is the problem... Yanfly's plugins all work so well though. Here's a screen shot of the plugin command from the help window of the plugin it's self.
 

Attachments

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Thanks for your help! Maybe someone else can help figure it out.
 

Raths Rants

Lord Procrastinator
Veteran
Joined
Mar 9, 2014
Messages
108
Reaction score
26
First Language
English
Primarily Uses
RMMZ
Thanks for your help! Maybe someone else can help figure it out.
I popped over to Yanfly's site and read up on the system.

From what I read I don't think a standard event will work. The subclass would have to replace the primary class. If not, the event would have to call the location of the subclass for it to work. Your original event is checking the actor's (primary) class.

You mentioned the 3 IF statements also. I would review that if it was working before.
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Yeah, its late I'll take a look tomorrow. Thank you very much.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top