MZ Change class when equipping armor

Hello, im new in RPG Maker, so im maybe be dumb sometimes.
I need the character's class to change while wearing armor, while maintaining the level. To ensure that he forgets his old skills and immediately acquires new ones from the class. Im see only old post for rpg maker xz, but not for mz.
I would really appreciate some help.
Depending on how many Characters you have, this can be changed but this is currently to how it works:

add the <class:swordsman> into the Note section of your Armor, In the Common Events, create a Common Event that is being triggered by an active Switch,
If the Character's Equipment has the meta tag "class" in it and it's called "swordsman" it'll change the character's class into that.
However, If your Armor can only be worn by one class this won't fully work so you need to make all classes able to wear all armor types to get this to work.

It can be done without any plugins but it would require some database work and at least one common Event.
1752939396346.png

1752939435871.png
What is the condition that should be met, so that the class change should happen?
Is the Armor the piece that is responsible for the Class Change or perhaps a specific type of equipment?

It can be done without any plugins but it would require some database work and at least one common Event.
In my game, when MC equips the different hats, they change their stats, skills, and playstyle.
I thought to implement this through classes, so that when you put on a certain hat, the hero's class changes.

It's kinda hopeful 🙂
Depending on how many Characters you have, this can be changed but this is currently to how it works:

add the <class:swordsman> into the Note section of your Armor, In the Common Events, create a Common Event that is being triggered by an active Switch,
If the Character's Equipment has the meta tag "class" in it and it's called "swordsman" it'll change the character's class into that.
However, If your Armor can only be worn by one class this won't fully work so you need to make all classes able to wear all armor types to get this to work.

It can be done without any plugins but it would require some database work and at least one common Event.View attachment 345460
View attachment 345461
Oh, sorry, dont see this message. That's what I need! Thank you very much
It can be done without any plugins but it would require some database work and at least one common Event.View attachment 345460
So you're just going to have a common event running all game checking every single frame whether an armor is equipped or not? LOL.

OP, just so you know this is really bad for performance and will compound into lagging issues especially if you have other parallel events.

The plugin solution is to use something like Waynee95's On Equip Eval that will run a script to change the equipped actor's class once, not every single frame.
+1 for the Waynee95 recommendation mostly cause it'd be less janky.
With a common event setup like this, the class change can only happen once you leave the menu. You'd end up with things like not being immediately able to equip a staff when swapping from the swordsman hat to the wizard, or swapping to a swordsman hat from the priest hat and still being able to use heal spells until you return to the map for the class to change to actually happen.
So you're just going to have a common event running all game checking every single frame whether an armor is equipped or not? LOL.

OP, just so you know this is really bad for performance and will compound into lagging issues especially if you have other parallel events.

The plugin solution is to use something like Waynee95's On Equip Eval that will run a script to change the equipped actor's class once, not every single frame.
Okay, im gonna try this method. Thank you for your time and massive brain, hehe
So you're just going to have a common event running all game checking every single frame whether an armor is equipped or not? LOL.

OP, just so you know this is really bad for performance and will compound into lagging issues especially if you have other parallel events.

The plugin solution is to use something like Waynee95's On Equip Eval that will run a script to change the equipped actor's class once, not every single frame.
(Sorry to ask, but I haven't found any guides for this plugin. I couldn't use it properly, so I'm asking...)
You'll need to get both the WAY_Core and the WAY_CustomOnEquipEval plugins from Wayne95's pluginlist first, after that you can simply read on what the WAY_CustomOnEquipEval needs in order to trigger a code you setup if you either Equip or Unequip an Armor or Weapon.


JavaScript:
<Custom On Equip Eval>
code
</Custom On Equip Eval>

//This is to check if an Armor or Weapon has been Equipped

<Custom On Remove Equip Eval>
code
</Custom On Remove Equip Eval>

//This checks whenever you unequip an Armor or Weapon.

However in your Case since you want some Armor to change your classes you want to include classes into each Armor piece.

a working example is something like this:
JavaScript:
<Custom On Equip Eval>

a.changeClass(2,true)

</Custom On Equip Eval>

<Custom On Remove Equip Eval>

a.changeClass(1,true)

</Custom On Remove Equip Eval>

HUGE Thanks for pointing out the issue about my previous way of handling this goes to AquaEcho, as I didn't know of this plugin's existence before!

EDIT: edited the code to keep the experience gathered for the character!
You'll need to get both the WAY_Core and the WAY_CustomOnEquipEval plugins from Wayne95's pluginlist first, after that you can simply read on what the WAY_CustomOnEquipEval needs in order to trigger a code you setup if you either Equip or Unequip an Armor or Weapon.


JavaScript:
<Custom On Equip Eval>
code
</Custom On Equip Eval>

//This is to check if an Armor or Weapon has been Equipped

<Custom On Remove Equip Eval>
code
</Custom On Remove Equip Eval>

//This checks whenever you unequip an Armor or Weapon.

However in your Case since you want some Armor to change your classes you want to include classes into each Armor piece.

a working example is something like this:
JavaScript:
<Custom On Equip Eval>

a.changeClass(2,true)

</Custom On Equip Eval>

<Custom On Remove Equip Eval>

a.changeClass(1,true)

</Custom On Remove Equip Eval>

HUGE Thanks for pointing out the issue about my previous way of handling this goes to AquaEcho, as I didn't know of this plugin's existence before!

EDIT: edited the code to keep the experience gathered for the character!
Big thanks, dude 🙂 You all really help me in realising my idea in life. Big, good luck in your life

Original thread: https://forums.rpgmakerweb.com/threads/change-class-when-equipping-armor.179020/