Change Class when Equipping Armor

I have seen this in previous iterations of RPG Maker, but none so far yet in MV.

I would like to have a class change to occur when a character equips a different piece of armor. For example, when a character equips armor ID #1, class changes to ID #1. When the armor is removed, the class changes to a default ID #.

I had a script in VX Ace that achieved this function by using the tag <class change: x> in the notes section, where 'x' was the ID number of the specific class. There was also a condition in the script itself that allowed the class to change to a default ID when the piece of equipment was removed. Sadly, I cannot remember the name of this script, and all of my VX Ace data has been lost.

Since its release, MV seems to have a plugin that allows this to happen based on equipping a certain weapon type. Here's a link to the forum post: http://forums.rpgmakerweb.com/index.php?/topic/48355-class-change-when-you-equip-a-new-weapon-type/.

So, any help would obviously be greatly appreciated, whether it be a slight modification of this poster's script (with the proper permission, of course), a link to an already existing plugin (though I doubt there is one yet), or an original work.
See if this helps?

http://pastebin.com/YAiicVmQ

<class_change:3>for example, on any equip (but you probably should stick to using it on a single equip type in your game).
I posted a script that changes your class based on what weapon type you are using.

For example: any sword makes you a swords man and any staff you equip makes you a wizard.

I might be able to remake it to where it does it based on armor type. ie wizard robes turn you into a wizard.

Only problem is you can equip multiple armors but only one weapon which is why the weapon one was easy. Lemme think for a minute.

Edit 1: I suppose if you remove all armor at once then re-equip it might work.

Edit 2: I suppose you can check and see if the armor you are equipping is a different then what you are wearing then you can force the game to un-equip all armors. Then make it change your class.

Edit 3: I think that checking to see if you are equipping a different armor type and forcing you to un-equip all armors (except for the one you are equipping), this will change your class and you will have one armor equipped and then must equip the same armor type or it will change your class again.
I posted a script that changes your class based on what weapon type you are using.

For example: any sword makes you a swords man and any staff you equip makes you a wizard.

I might be able to remake it to where it does it based on armor type. ie wizard robes turn you into a wizard.

Only problem is you can equip multiple armors but only one weapon which is why the weapon one was easy. Lemme think for a minute.

Edit 1: I suppose if you remove all armor at once then re-equip it might work.

Edit 2: I suppose you can check and see if the armor you are equipping is a different then what you are wearing then you can force the game to un-equip all armors. Then make it change your class.

Edit 3: I think that checking to see if you are equipping a different armor type and forcing you to un-equip all armors (except for the one you are equipping), this will change your class and you will have one armor equipped and then must equip the same armor type or it will change your class again.
There's already a Game_Actor.releaseUnequippableItems() method - it unequips anything that can't be equipped by the current class. So you change classes, and then call it.

At least that's how I did it in my above script.
I think the problem occurs when you change classes but can't change back if you cant equip a different armor type. So for example if you are a knight but put on wizard robes and change to a wizard well if the wizard can't wear plate mail then you cant switch back into a knight.
I think the problem occurs when you change classes but can't change back if you cant equip a different armor type. So for example if you are a knight but put on wizard robes and change to a wizard well if the wizard can't wear plate mail then you cant switch bank into a knight.
You can just unequip.
Well if you had it set up so that when you are basically naked then you become a default class that can equip any armor type would work easy.
Mellye. this is exactly what I'm looking for! Thank you so much! I have a slight issue, could be due to compatibility with some other plugins that I also am using (Yanfly engine perhaps....). As I start to playtest my game, I get a Type Error that says "object is not a function". I have this plugin positioned at the bottom of my list currently. Should I have it set above any Yanfly scripts? Or is there a change I should make to help compatibility with Yanfly?
Mellye. this is exactly what I'm looking for! Thank you so much! I have a slight issue, could be due to compatibility with some other plugins that I also am using (Yanfly engine perhaps....). As I start to playtest my game, I get a Type Error that says "object is not a function". I have this plugin positioned at the bottom of my list currently. Should I have it set above any Yanfly scripts? Or is there a change I should make to help compatibility with Yanfly?
Just to be sure, if you run it without any other plugin, does it work?
Negative, Ghost Rider. The pattern is full.

Actually, when I use it with Yanfly's stuff, I get the error immediately at startup. If I use it by itself, the error pops up when I select the option to change equipment. Same error message both times, though.
Negative, Ghost Rider. The pattern is full.

Actually, when I use it with Yanfly's stuff, I get the error immediately at startup. If I use it by itself, the error pops up when I select the option to change equipment. Same error message both times, though.
Weird, when I test here it works normally. I'll send you a PM so we can try to debug what's happening.
Object is not a function means you probably have parenthesis where there shouldn't be any.

Ex. something();  verses something;
Object is not a function means you probably have parenthesis where there shouldn't be any.

Ex. something();  verses something;
He's getting the error on the ChangeClass function; possibly a wrong parameter is being sent to it for some reason.

Edit: We found out what the bug was - an outdated version of rpg_object.js had a bug in the changeClass method, it seems. It was trying to invoke "_exp()", which doesn't exist; the correct method would be currentExp().
This is exactly what I was looking for, thanks.
How do you fix or update rpg_object.js?  I can't seem to find a downloadable version anywhere.
There is a thread with updates - it's got a link where you can get the latest version, and instructions on what/where to copy.
How do you fix or update rpg_object.js?  I can't seem to find a downloadable version anywhere.
If you're using RPG Maker MV on steam, you download the update automatically.

If your project already existed before the update, you'll need to copy the files in the  <rpg maker mv folder>/newData/js to <your project folder>/js/.

If you're not using Steam, or for more info in general, see/ask here: http://forums.rpgmakerweb.com/index.php?/topic/47569-rpg-maker-mv-updates/
Thanks for the quick response!  And I'm excited about this plugin - great work!

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