Utils: Class Changing

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

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

Script: download here

Installation

Place this script below Materials and above Main

Usage

You can use script calls to change classes, with some extra options

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 class skills

Note the difference between an actor’s skills and an actor’s class skills. The class skills are specifically the skills that come from the class (for reaching certain level requirements, for example). You may choose to transfer this.

By default, exp is not preserved and learned skills are preserved, which means if you have some Soldier skills and you change to a Monk, you would still have those Soldier skills.

Example

Suppose you want to switch actor 4‘s current class to class 10, transferring EXP, but not transferring class skills, you would make the script call:

change_class(4, 10, true, false)

 

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

12 Responses

  1. kejopo says:

    "If you want to get rid of all old skills, replace line 101

    update_class_skills(old_class_id)

    with

    init_skills"

    That works perfectly! Thank You!!

  2. kejopo says:

    Hi,
    The script works great at removing and adding skill. I do have one issue, the skills bought using your skill shop don't get removed. Would you be willing to try to see if its possible to remove those skill as well?

    • Hime says:

      The "remove skill" functionality in this script removes "learned" skills that come with the class. It doesn't remove any skills that you obtained through other means, such as a learning book or the skill shop. Is there some reason why those extra skills should be removed as well?

      • kejopo says:

        Hi,
        I'm using the default method of learning skills to learn mandatory skills for the class. Those get removed with this script. I was then using the skill shop script to create optional skills for specific classes. Iwas hoping the script would clear both the mandatory and optional skills when the character changes classes.

        Example: Character starts out as a mage and starts off with a basic magic ranged attack(mandatory skill) . But optionally the mage can buy other elemental attacks (thunder, fire…. ect). That same character changes classes and becomes a knight and no longer should be able to use magic. The way the script is set up now the only skill that would get removed is the basic magic ranged attack, the knight would still be able to use the optional attacks left over from being a mage.

        My game has the option to switch between the 5 basic classes before being locked into class tree. So if someone wanted to make an all caster party they could switch the classes of the characters.

        Let me know if that doesn't make sense.

        • Hime says:

          If they player switches from a mage to a knight (losing all magic), can they switch to mage again? If so, how would the skills work then?

          • kejopo says:

            The mandatory skills get restored using your script, the optional ones become available in the skill shop for purchase again. The characters stats get reverted back to what they were before the switch(mp and magic attack are restored). My classes don't gain stats through the default system. They gain preset stat points on level up(same stat gains every level). Basically the stat gains are static. My intent is really for the characters to be constantly switched back and forth. If i get everything works out it would work like tactics ogre knights of lodius, where there are a couple classes the player can switch there characters to very early in the game.

            Hopefully that makes sense I tend to ramble……

          • kejopo says:

            my response below should have said this

            "My intent is really for the characters not to be constantly switched back and forth."

          • Hime says:

            If you want to get rid of all old skills, replace line 101

            update_class_skills(old_class_id)
            

            with

            init_skills
            

            The whole purpose of this logic is to remove class-specific skills, so if you don't care about other skills you can just remove all of it and then re-build the skill list based on the new class.

  3. Jin says:

    It’d be nice if the script call ‘change_class(4, 10, true, false)’ could be used as a notetag instead. It’d be very convenient for scripts that allows their players to change classes freely.

  4. Turos says:

    Awesome script! Thanks for sharing it.

    I am having trouble, though, with changing classes back and forth at will. It will update from the beginning class to the secondary class, and back again, but stops there, allowing no more changes. Is this normal? Is there a way to allow further class swapping?

    Thanks again for the script!

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax