Change class with an item?

Hi everyone,

I'm trying to let the player change the class of the actor that an item is used on, but I'm really unsure about how I can do that with common event, as I'd need to somehow know which actor the item is being used on...

Any ideas?

Thanks!
There is a way to do this through events, but... it would be so chalk full of conditional branches your better off doing a simple script to do it.

Also, do you want it to be based on the weapon, or weapon type?
Hmm I see...

I wanted to have a simple consumable item - for example ''Royal Crest'' used on someone changed their class to ''Knight'' etc.

I'd use something else, but given how my characters are ''randomly'' generated I want the player to be able to change the class afterwards to suit their playstyle better.
Ohhh that, you can do that easily. I thought you meant weapon, hold on a second.

EDIT: This seems to be harder then I though, thought I could do it with only 1 or 2 lines of script, but the way I thought I could do it is not working, I may need a bit more time lol
What you could do is let the item add an invisible state which you can track (and remove) within the common event.

Using a script might be easier though, as you might save forking for every possible actor... 🙂

Edit: Uhh, I used this trick in the previous makers a lot, but in VXAce a dead character is automatically immune to state infliction and there is no way to get around that without scripting. So there might be a problem after all, if you don't prevent occurrance of this case.
What you could do is let the item add an invisible state which you can track (and remove) within the common event.
Thats one way to do it. Lol

Probably the most simple way.

EDIT:

You can use this script

$game_party.target_actor.change_class(number, true or false)
What this does is it saying change the class to (number) and keep exp (true or false)

$game_party.target_actor.change_class(2, true)

This line would say change the Actors class to ID 2 (in my case its monk from default) and to keep the current EXP
Thats one way to do it. Lol

Probably the most simple way.

EDIT:

You can use this script

$game_party.target_actor.change_class(number, true or false)What this does is it saying change the class to (number) and keep exp (true or false)

$game_party.target_actor.change_class(2, true)

This line would say change the Actors class to ID 2 (in my case its monk from default) and to keep the current EXP
Worked just fine, thanks! 🙂

That said, when changing class the actor didnt get all the previous skills (as in lv 1 skills when reseting to lv 1)...

Is there a way to automatically learn all possible skills (as in the skills that your level is high enough for) somehow?
Really? You should get the skills that are set inside your class. So if your level 1, then change your class your still level 1 with that specific classes level skills. I thought thats how that should work, let me test it out.

As your doing this at the start of your game, you can use this:

$game_party.target_actor.learn_skill(id)

where id is the skill number. If you want them to have access to changing their class all the time and keep their levels let me know. You'd have to it differently, and maybe with a full script :/
Nah, I can just add the skills manually, don't worry - they'll always change to level one, so there won't be too many skills to add.

Afterwards I guess that leveling will add skills as usual.

Again, thanks a ton for your help, I really appreciate it 🙂
No problem 🙂

I'm learning scripting so doing small things like this helps me a lot. Finding what methods do what, etc etc

EDIT:

Oh and you will have to remove the current skills they have, else they will have access to all skills previously learned.
Oh and you will have to remove the current skills they have, else they will have access to all skills previously learned.
Completely forgot about that, how would I do that since any class can change to any class? Go through the list and ''forget'' all the possible skills?

Would take quite a bit of time, is there a more efficient way perhaps? Like checking the previous class so I just forget those skills maybe?
Okay, so it took me a good time to figure this out, probably around 30-40 minutes. But I found out a way to do it, I'm not sure if its the best way.. but... here it is

$game_party.target_actor.skills.each do |skill|id = $game_party.target_actor.skills[0].id$game_party.target_actor.forget_skill(id)end
You will want this before you learn your skills, because it will delete every single you skill you have.

So something like this:

$game_party.target_actor.skills.each do |skill|id = $game_party.target_actor.skills[0].id$game_party.target_actor.forget_skill(id)end$game_party.target_actor.change_class(2, true)$game_party.target_actor.learn_skill(16)
I did it before changing the class as well, just because. Lol
Wow, thanks a lot! 

This will save me a lot of time 🙂
You are welcome 🙂

Original thread: https://forums.rpgmakerweb.com/threads/change-class-with-an-item.37310/