Class Changing

This script addresses the issue where the actor changes classes, but the old class skills are still learned and the new class skills are not automatically learned.

Some convenience methods for class changing is also provided as script calls

Download

Get it at Hime Works!

Installation

Place this script below Materials and above Main

Usage

Plug and play.

You can use the script call to change classes

change_class(actor_id, class_id)change_class(actor_id, class_id, keep_exp)change_class(actor_id, class_id, keep_exp, keep_skills)Where`actor_id` is the ID of the actor you wish to change classes

`class_id` is the ID of the class to change to

`keep_exp` is true or false, whether you want to transfer the current exp

`keep_skills` is true or false, whether you want to keep the learned skills

For example

change_class(4, 10, true, false)Will change actor 4's class to class 10 while preserving the actor's exp, but any learned skills (from the old class) are not preserved.By default, exp is not preserved and learned skills are preserved.
wow i was just thinking about this issue yesterday with my game 

thanks for adding this lol
By default, exp is not preserved and learned skills are preserved. 

                     

                                                               edit?^^^
Learned skills are preserved by default.
I set skills in my game a little differently. You don't learn them through class but via a trainer, based on class (via variables.. class = 1 = skill learnables)

Is there a way to tag skills to set them to removable/permanent?

If skills were tagged in the skill tab

<Class 1>

and if you switched from class 1 it was removed

and 

<Class Nill>

no matter what class you switched to it was kept, it would make this script much more versatile.. (not to mention amazing in my case 😉
This script is for the default class system if you are using an alternative way of learning skills it would be better to get a custom-made script.
Do you take commissions then? Send me a PM 😛
Newbie here.

So I threw this into my code and tested it and I can change my characters' classes back and forth while keeping their levels and skills, but their spells are getting lost in the process. Is this scrip supposed to track their spells as well or will I have to find/write more code?
You can keep any learned skills by passing in true for the keep_skills argument

Code:
change_class(actor_id, class_id, keep_exp, keep_skills)change_class(1, 4, true, true)
Very useful, (I'm not sure how this one snuck by me for so long...  ) :distrust: . This would would perfectly with my promotion scripts. One request though. Can you make options at the top to change the defaults of the "keep_exp" and "keep_skills". That way it can just be thrown in above one of mine without any extra add-ons.
Is there a way to have the character become level 1 on the new class?
Use false for keep_exp
will this affect stats?  let's say you class change at level 10.  Are your stats any better if you would wait until level 15?  Or does it simply start you at level 1 with the same stats regardless?
It is based on class parameter curves, so whatever the stats are for level 1, that's what it is.


There's things like this, which picks stats based on the highest level class, but there really is no "carry over" stats on class change for the default system for the most part.
I was using this script in today, and I placed it into the (insert here). I went to play test the game and then this message was shown to me: Script '(insert here)' line 26: NameError occurred.

                                                                                                                                                                                                                       undefined local variable or method 'actor_id' for main😮bject             
I was using this script in today, and I placed it into the (insert here).                                                                                                                                            undefined local variable or method 'actor_id' for main😮bject
You should have pressed the [insert] key on that slot to get a new, empty script slot and then copied the entire script (all 114 lines) into the new slot..
I'm guessing that you either left something from the explanation of the insert slot there, or copied only part of the script into that slot - both would result in errors...
Game_Interpreter line 1411
undefined method "features"

Original thread: https://forums.rpgmakerweb.com/threads/class-changing.16576/