Lazi Class Change System

Class Change System
v. 1.1.3


I posted a buggy and feature incomplete version of this in the In Development forum about a week ago. Now that it's feature complete and relatively (I haven't found any bugs while testing the most recent version, but I'm sure someone will find a way to break it.) bug free, I'm posting it here as a first release version.
Introduction
This plugin introduces a class change system and a UI for selecting the user's class from a list.
There are two versions of this plugin:
  • Lazi_ClassChangeBasic -> Use this if you don't intend to use Actor Mode. It has the code for that removed which reduces the file size and number of functions overridden considerably.
  • Lazi_ClassChange -> Use this if you want to use Actor Mode. It contains everything in the basic version with the Actor Mode functionality added.
They shouldn't be used together. I included a safeguard that SHOULD prevent any catastrophic errors, but better to be safe.

Features
Implements three different forms of a class change system:
  • Shared EXP - In this mode the Actor has a single EXP number that is shared across all classes. This results in all experience gained by the actor counting towards levels for every class.
  • Individual EXP - In this mode each class has it's own EXP amount and the EXP earned when an actor has a class set as it's active class only contributes to that one class.
  • Actor Mode - In this mode, each actor has two sets of levels: an intrinsic "base" level and class levels for each class. The intrinsic base level is used for determining the parameters of the actor while the currently active class level is used to determine what traits and skills the actor has access too.
    • Stat Gain - Two stat gain systems exist for this mode: a "normal" mode where the actor's intrinsic "base" class level determines their parameters and a "stat gain" mode where the actor's parameters are increased at each level based on their currently active class when they gain that level.

Video
Spoiler: Video
Embedded below is my amateurish video showing the basic functionality of the Shared EXP and Class EXP modes:

Actor Mode:



How To Use
Spoiler: How To Use
Plugin Parameters
  • Add Entry To Menu -> if set to true, the plugin will add an entry to the menu just below the "Status" entry. If you wish for another plugin to manage adding the menu entry for this plugin to the menu, make sure that plugin sends the "classchange" symbol to the menu handler.
  • Menu Option Text -> The text that should be displayed in the menu for the option. The default is "Class Change"
  • Level System Type -> The type of level system you wish to use.
  • Preserve Percentages for HP/MP -> This will look at the percentage of HP/MaxHP MP/MaxMP of a character before switching classes and ensure that the new class has the HP/MP set to the same percentage of their MaxHP/MaxMP
  • (Shared EXP Mode) Maintain Level + Percentage -> In Shared EXP mode, this will modify the actor's total EXP to maintain the same level and percent to next level when changing classes. This does not actually affect the growth rate of the class, so a class with a faster growth rate will result in the actor leveling up faster and then if the actor switches back to a class with a slower growth rate, they will keep the same level and percent to next.
  • (Actor Mode) Level Up Text -> This is the text that will be shown when an actor gain a level in their base class. The default Level Up text will be used when they gain a level in a normal class and this can be altered in the usual place.
  • (Actor Mode) Level Up Mode -> I would recommend not changing this for now. The Stat Gain mode is EXTREMELY buggy presently. The basic implementation is there and the stats are calculated correctly, but the UI has some display issues with it. Namely the HP and MP bars do not presently display.
  • (Actor Mode) Current Level For Stat Gains? -> This option affects how the stat gain mode functions. If set to true the difference between the stats in the current level and the new level are calculated and these deltas are used to increment the stats of the actor. If set to false, the level 1 stat values for the current class are used to increment the stats of the actors.
Add a class to an actor's class list
  • Place a <LaziGiveClass:[classId]> notetag in the Actor's notes
  • Use the "Modify Actor Classes" plugin command
    • This plugin command also allows you to "disable" a class, this will cause it to appear greyed in the class list just like the currently active class
    • This plugin command also allows you to "remove" a class. This removes the class from the actor's class list. It will not appear and if added again will act as if the character never had that class.
    • Parameters:
      • Type of Action -> Whether you want to add, disable, or remove the class
      • Actor -> the ID of the actor you wish to manipulate. This should match with the database.
      • Class -> the ID of the class you wish to manipulate. This should match with the database.
Modify The Menu Option
By default, the menu option will be enabled when the basic commands (Status, Items, Equip, etc.) are enabled and disabled when they are disabled. However, the "Enable/Disable Menu Option" plugin command allows you to set the menu option to one of three states:
  1. Enabled -> The menu option will appear and be selectable
  2. Disabled -> The menu option will appear and not be selectable.
  3. Removed -> The menu option will not appear in the menu.
Actor Mode
If you wish to use actor mode, some additional setup is needed to ensure each actor is using the correct base class for their parameters. This is done by using the <LaziGiveClassDefault:[classId]> notetag in the actor's notes. This should be set to a class that has the parameter curves and EXP gain rate set to what you wish for that actor. If this notetag isn't present in the actor, it will use the first class that ends up in it's class list. This will either be A)the first class added by <LaziGiveClass> or, if none are present, the class that is set in the database as the actor's starting class.

Issues
Spoiler: Issues
In actor mode with stat gain, if the "Status" menu option is accessed without switching classes at least once, the class stats are shown instead of the correct stats. -> This doesn't affect the actual stat values used for other things only this UI element. I am currently trying to determine why this happens.

Some plugins could also cause display issues with Actor Mode due to it using a separate leveling system. I found one conflict in my testing so far, but other plugins that use or modify _exp will likely also have issues:
  • VisuMZ Core -> Only display issues, not fixable due to their obfuscation of their code. The display issues are minor and do not cause any errors.
    • The class name to not display properly. Instead of "Swordsman Lv. 50" only "Swordsman" will be displayed. This is only a display issue, the actual data is correct and the level of the class can be still be seen in the class change screen.
    • The EXP bar added by the VisuMZ Core plugin will not display properly. This EXP bar will appear different for each class the actor switches too. This is because they draw the EXP bar using the default _exp value of the actor
The plugins should be relatively bug free. If you discover a bug please post it here so it can be fixed.

Future Additions
Spoiler: Future Additions
  • Optimize Code
  • Actor Mode -- Ability to see both current and next level EXP for class in addition to base
  • Shared EXP/Actor Mode -- Ability to automatically learn classes when reaching specific levels
  • Individual EXP -- Ability to automatically learn classes when reaching either a specific level in one class, or a set of specific levels in several classes
  • Ability to mark some skills are innate for an actor and have them learned regardless of the current class
  • Actor Mode -- Add the ability to have traits and skills assigned to the actor's base class be learned and always available
Feel free to post any other ideas for additions.

Terms Of Use
Spoiler: Terms Of Use
Free for use in any commercial or non-commercial product, though a credit to "Lazislacker" would always be welcome.

Download
Spoiler: Download
Plugin can be found here
The Actor mode is beautiful. I used to give people a base class and only have changeable subclasses in MV to do the same thing, but having it baked right into the plugin? Love it. Thank you for making this!
Bug: If you enter Class Change menu and press "OK" button, it gives an error, instantly. Occur even if you enable this plugin alone.
Can you provide what settings you are using?

I also just created a new release that fixed several bugs that I discovered that might fix this. I found quite a few bugs that made it into the initial release thanks to my inexperience with git tags.
Can you provide what settings you are using?

I also just created a new release that fixed several bugs that I discovered that might fix this. I found quite a few bugs that made it into the initial release thanks to my inexperience with git tags.
Even default settings would cause this, I tried the updated version, it is the same. I even created new project, tried with tags and without, it is same: Cannot read property 'enabled' of undefined
That's really strange. I just made an empty project and downloaded the initial release from Github to test it. With the default settings both the Class Change and Class Change Basic worked. I'm not sure what the source of the error is. If you can do the following it'll help a lot in tracking it down:

When the error shows if you press F12 and click console then take a screenshot of it, there will be a stack trace. That will help to see where the error actually is.
Even default settings would cause this, I tried the updated version, it is the same. I even created new project, tried with tags and without, it is same: Cannot read property 'enabled' of undefined
Okay. I managed to replicate this bug and pushed a bug fix to Github. The fix can be found here.
This is without any notetags, since i deleted old project i had for the test. Also it is not like it doesn't work at all, it gives error if you enter class change menu and just press "ok" button. Additionally, some of notetags didn't work, but giving class through plugin command did work(before update, no idea how it is after).
Additionally, can you explain something? For example this notetag:
<LaziGiveClass: [classID]>
Can i use it like that: <LaziGiveClass: [1, 2, 3]>
Or like that: <LaziGiveClass: [1 2 3]>
Or only like that:
<LaziGiveClass: [1]>
<LaziGiveClass: [2]>
<LaziGiveClass: [3]>
1600097135596.png
This is without any notetags, since i deleted old project i had for the test. Also it is not like it doesn't work at all, it gives error if you enter class change menu and just press "ok" button. Additionally, some of notetags didn't work, but giving class through plugin command did work(before update, no idea how it is after).
Additionally, can you explain something? For example this notetag:
<LaziGiveClass: [classID]>
Can i use it like that: <LaziGiveClass: [1, 2, 3]>
Or like that: <LaziGiveClass: [1 2 3]>
Or only like that:
<LaziGiveClass: [1]>
<LaziGiveClass: [2]>
<LaziGiveClass: [3]>
View attachment 160684
I was playtesting with the mouse so that's why I never experienced that. But tested using the keyboard only earlier and found/fixed the issue. I also didn't notice that it doesn't default hightlight the first class when you open the scene. I used the wrong window select command, I think I have that fixed too but won't be able to test it until tonight.

As of now each class must have it's own tag. I'm planning on modifying it to allow several classes in one soon, I didn't think about people adding a large list of classes at the start. I expected most of them to come through events or items to "learn" classes since that's how I was designing my game to function when I wrote this.
I was playtesting with the mouse so that's why I never experienced that. But tested using the keyboard only earlier and found/fixed the issue. I also didn't notice that it doesn't default hightlight the first class when you open the scene. I used the wrong window select command, I think I have that fixed too but won't be able to test it until tonight.

As of now each class must have its own tag. I'm planning on modifying it to allow several classes in one soon, I didn't think about people adding a large list of classes at the start. I expected most of them to come through events or items to "learn" classes since that's how I was designing my game to function when I wrote this.
I see, i will try to test it in-depth as soon as it gets update, since you replying fast and it is possible to fix/shape it into a finished plugin soon enough 😀 thanks for your time!
A new version is now available. This version fixes the keyboard only bugs as well as introduces the ability to give multiple classes with one tag.
Multiple classes can be given through the use of commas for example:
<LaziGiveClass: 1,3,5,6> will give that Actor those classes.

Here is a link to the release.
i probably did something wrong but, i gave 2 actors the tag <lazigiveclass:1>
when i open the class change screen this is what happens

(i'm using all the others visustella plugins with this, so maybe it's some compatibility issues
i probably did something wrong but, i gave 2 actors the tag <lazigiveclass:1>
when i open the class change screen this is what happens

(i'm using all the others visustella plugins with this, so maybe it's some compatibility issues
Definitely is.
It has nothing to do with having the two tags on different actors. It's to do with the window drawing the class change screen.
It appears they're modifying the Window_Base "drawItemName" function instead of only modifying it in specific windows they want it to show in (I'd assume equipment/items based on the plugin name).
It is fixable on my end, but kind of annoying they did that. I'll download their plugin and work on a workaround patch.

Can you either post or pm me a copy of the settings you have for their plugin so I can match it and reproduce this easily?
Okay. I pushed a patch that should fix this compatibility issue.
Download the latest release (v1.1.3) here and this issue should be solved.
Okay. I pushed a patch that should fix this compatibility issue.
Download the latest release (v1.1.3) here and this issue should be solved.
thank you, awesome reaction time, gonna test further and let you know if i run in further issues =)
Hello. I got a problem.
I'm trying to set an event where after you've talked with some guy the class change system pops up so You can choose your class. I am using few of VisuMZ plugins.

This happens when I click "Select class" talking to the guy.


This is the error from the console:
Code:
rmmz_managers.js:2030 TypeError: Cannot read property 'LaziClassChange_classes' of undefined
    at Game_Interpreter.Lazi.ClassChange.addActorClass (Lazi_ClassChange.js:347)
    at Function.PluginManager.callCommand (rmmz_managers.js:3104)
    at Game_Interpreter.command357 (rmmz_objects.js:11270)
    at Game_Interpreter.<computed>.<computed> (VisuMZ_0_CoreEngine.js:6319)
    at Game_Interpreter.<computed>.command357 (VisuMZ_1_BattleCore.js:14060)
    at Game_Interpreter.<computed> [as command357] (VisuMZ_1_EventsMoveCore.js:6052)
    at Game_Interpreter.executeCommand (rmmz_objects.js:9621)
    at Game_Interpreter.<computed>.<computed> [as executeCommand] (VisuMZ_1_EventsMoveCore.js:6052)
    at Game_Interpreter.update (rmmz_objects.js:9526)
    at Game_Map.updateInterpreter (rmmz_objects.js:6757)
SceneManager.catchNormalError @ rmmz_managers.js:2030
DevTools failed to parse SourceMap: chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/libs/pixi.js.map


Also, the settings are set to disable the "Class change" option in menu but it's still there. So I decided to run a parallel event - plugin command - remove option from menu on the start of the game.

And I'm getting this:

TypeError
Cannot set property 'MenuAccess' of undefined


Code:
rmmz_managers.js:2030 TypeError: Cannot set property 'MenuAccess' of undefined
    at Game_Interpreter.Lazi.ClassChange.ModifyMenuAccess (Lazi_ClassChange.js:400)
    at Function.PluginManager.callCommand (rmmz_managers.js:3104)
    at Game_Interpreter.command357 (rmmz_objects.js:11270)
    at Game_Interpreter.<computed>.<computed> (VisuMZ_0_CoreEngine.js:6319)
    at Game_Interpreter.<computed>.command357 (VisuMZ_1_BattleCore.js:14060)
    at Game_Interpreter.<computed> [as command357] (VisuMZ_1_EventsMoveCore.js:6052)
    at Game_Interpreter.executeCommand (rmmz_objects.js:9621)
    at Game_Interpreter.<computed>.<computed> [as executeCommand] (VisuMZ_1_EventsMoveCore.js:6052)
    at Game_Interpreter.update (rmmz_objects.js:9526)
    at Game_Event.updateParallel (rmmz_objects.js:9420)
SceneManager.catchNormalError @ rmmz_managers.js:2030
DevTools failed to parse SourceMap: chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/libs/pixi.js.map


Plugins that I use:

Hey, I can't get the LearnClass to work.
How do I define which class the actor gets after reaching level xx with a different class?
I tried to add the notetags like this
<LaziGiveClass:18> <LaziLearnableClassOR:|16,5|>
But that unlocks the class directly
I also tried
<LaziLearnableClass:18> <LaziLearnableClassOR:|16,5|>
which of course didn't do anything.
I'm using the Class EXP leveling system.
The first class is adventurer (ID:0001) which at level 10 can change to:
Rogue (ID:0004)
Apprentice (ID:0005)
Warrior (ID:0006)

I put this tag in the Actor notes (Was testing with 1 class first before I added the rest):

Code:
<LaziGiveClassDisable: 0004>


I've tried these tags in the Rogue Class notes individually:

Code:
<LaziLearnableClass:10>
<LaziLearnableClassOR:|0001, 10|>

<LaziLearnableClass:10>
<LaziLearnableClassAND:|0001, 10|>

From my understanding that means the class (Rogue) is learnable at level 10, and requires Adventurer to be level 10. But it simply doesn't work. I've also tried just doing:

Code:
<LaziLearnableClassOR:|0001, 10|>

Also doesn't work. What am I doing incorrectly?
@LVMVS first thing would be to get rid of all the leading zeros. I don't know if that is the cause of THIS issue, but it will cause issues elsewhere.
@LVMVS first thing would be to get rid of all the leading zeros. I don't know if that is the cause of THIS issue, but it will cause issues elsewhere.
Thank you, however, I've given up on the learnable classes script, I wrote a Common Event that does that same thing. The issue now is that I can't disable the Class Change option on the menu. When I use the plugin parameters to disable it, it's still there, and when I use the plugin commands to disable it. My game gets this error:
1620236522945.png


The only other plugin I'm using is Visustella's MenuCore. I assume there is some sort of incompatibility.

Edit: I disabled Visustella MenuCore and it still won't go away. So that must not be it.

Original thread: https://forums.rpgmakerweb.com/threads/lazi-class-change-system.126836/