Custom Class Change V1.0.0

ArcherBanish

Veteran
Veteran
Joined
Feb 1, 2014
Messages
36
Reaction score
14
First Language
Portuguese
Custom Class Change v1.0.0

ArcherBanish
Introduction
A simple script that lets the developer have more control over the changing of an actor's class.

Features
This script provides a way to alter how the "Change Class..." event command works.
It adds three options.

  • Keep the current exp when changing to the new class.
  • Forgeting the skills from the old class.
  • Learning the skills from the new class that would have been learned that level or the previous levels.
It also provides a Plugin Command to call a class change with these options if the user does not wish to alter the "Change Class..." event command.
Information on how this works is provided in the Help section of the plugin.

How to Use
- Copy the plugin code into a .js file or download the CustomClassChange.js file from the link and add it to the "js/plugins/" folder.
- Load the plugin into the plugin manager.
- Use change the plugin settings are desired or simply call the desired Script Command from an event.

Plugin
[Download .js]

Code:
var Sterling = Sterling || {};/*:* @plugindesc v1.0.0 This plugin allows you to customize the Change Class command to some extent.* @author ArcherBanish** @param --Class Change--* @default** @param Keep Exp* @desc If you wish to keep the current Exp of the Actor on class change. [default = false]* YES - true NO - false* @default false** @param Forget Old Skills* @desc If you wish to keep the skills from the old class. [default = false]* YES - true NO - false* @default false** @param Get New Skils* @desc If you want the skills from the new class that could have been learned to be added. [default = true]* YES - true NO - false* @default true* @help* ====================* Class Change Options* ====================* This script is free for commercial or non-commercial projects, no credit necesary.** IMPORTANT: This script changes the Class Change command. (command321) So any script that changes this command will not work.* Scripts that change the changeClass method from Game_Actor may also break this script.** Parameter Description:* Keep Exp:* This is the main reason I made this plugin.* This parameter makes it so that when you change an actor's class he does not return to Level 1 but instead he retains the level he had in the first class.** Forget Old Skills:* When you change an actor's class, by default he keeps all the skills from the old class. Set this to true if you wish the actor to forget his old skills.** Get New Skills:* This is only aplicable if using the Keep Exp parameter. It makes it so that the skills that an actor could have learned are added to the actor after class change.* For Example if a Level 10 Warrior becomes a Level 10 Cleric he will not get the skill Heal that Cleric learns at Level 1 if you don't have this option set to true.** PLUGIN COMMANDS:* IF you dont wish to atlter the old Change Class Event you can also use plugin commands to do what you want.** Structure:* ChangeClass <command_option> <actorId> <newClassId>** Options:*  keepExp                      -> changes the level only keeping Exp.*  forgetOld                    -> forgets skils from the old class.*  learnNew                     -> learns skills from the new class.*  keepExp_learnNew             -> keeps the Exp and learns skills from the new class.*  keepExp_forgetOld            -> keeps the Exp and forgets skils from the old class.*  keepExp_forgetOld_learnNew   -> keeps the Exp, forgets skills from the old class and learns skills from the new class.*///=============================================================================Sterling.Parameters = PluginManager.parameters('CustomClassChange');Sterling.ClassChange = Sterling.ClassChange || {};Sterling.ClassChange.KeepExp = String(Sterling.Parameters['Keep Exp']);Sterling.ClassChange.ForgetOldSkills = String(Sterling.Parameters['Forget Old Skills']);Sterling.ClassChange.GetNewSkils = String(Sterling.Parameters['Get New Skils']);var customChangeClass = function(actorId, classId, keepExp, forgetOld, learnNew){  var actor = $gameActors.actor(actorId);  if (actor && $dataClasses[classId]) {    if(forgetOld){      actor._skills.forEach(function(skill){        var index = actor._skills.indexOf(skill);        if (index >= 0) {            actor._skills.splice(index, 1);        }      }, actor);    }    if(keepExp){      actor.changeClass(classId, true);    }else{      actor.changeClass(classId, false);    }    if(learnNew){      actor.currentClass().learnings.forEach(function(learning) {          if (learning.level <= actor._level) {              actor.learnSkill(learning.skillId);          }      }, actor);    }  }  return true;}Game_Interpreter.prototype.command321 = function() {  customChangeClass(    this._params[0],    this._params[1],    eval(Sterling.ClassChange.KeepExp),    eval(Sterling.ClassChange.ForgetOldSkills),    eval(Sterling.ClassChange.GetNewSkils)  );  return true;}Game_Actor.prototype.changeClass = function(classId, keepExp) {    if (keepExp) {        this._exp[classId] = this.currentExp();    }    this._classId = classId;    this.changeExp(this._exp[this._classId] || 0, false);    this.refresh();};var _Game_Interpreter_pluginCommand =  Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand = function(command, args) {    _Game_Interpreter_pluginCommand.call(this, command, args);    if (command === 'ChangeClass') {        var actorId = args[1];        var classId = args[2];        switch (args[0]) {        case 'keepExp':            customChangeClass(actorId, classId, true, false, false);            break;        case 'keepExp_learnNew':            customChangeClass(actorId, classId, true, false, true);            break;        case 'keepExp_forgetOld_learnNew':            customChangeClass(actorId, classId, true, true, true);            break;        case 'keepExp_forgetOld':            customChangeClass(actorId, classId, true, true, false);            break;       case 'forgetOld':           customChangeClass(actorId, classId, false, true, false);           break;       case 'learnNew':           customChangeClass(actorId, classId, false, false, true);           break;       case 'forgetOld_learnNew':           customChangeClass(actorId, classId, false, true, true);           break;        }    }};
 
Change Log:
27/10/2015 - v1.0.0: First Release
Credit and Thanks
- ArcherBanish
- Thanks to Yanfly since I used their plugins to learn how to make one.
 
Last edited by a moderator:

Blackikun

Villager
Member
Joined
Oct 24, 2015
Messages
7
Reaction score
0
First Language
German
Primarily Uses
Really nice :) but i have two question or more specifically wishes for additional feature... hope it´s okay to ask :)

1) Menü Scebe + Command - Is there any chance to make a scene where the player can change the class after some conditions (like a specific level or learn class a and c to get B) by himself and add this scene into the menü? It´s even okay to switch them every time and save there level (go from Mage LV10 to Warlock LV1 and back to have Mage LV 10 again while Warlock will still be LV1)

2) Automatic Chance the Grafic for all Actors when they set they classes - As an example like in an old Final Fantasy that we can have 2 Mages as different actors with the same sprite or in combination with my first wish, like an evolution. I know this can be easily made with a common event, but made this up for every actor can be a pain in the a** ^^"

it would be REALLY awesome, to get this *_*
 

ArcherBanish

Veteran
Veteran
Joined
Feb 1, 2014
Messages
36
Reaction score
14
First Language
Portuguese
Really nice :) but i have two question or more specifically wishes for additional feature... hope it´s okay to ask :)

1) Menü Scebe + Command - Is there any chance to make a scene where the player can change the class after some conditions (like a specific level or learn class a and c to get B) by himself and add this scene into the menü? It´s even okay to switch them every time and save there level (go from Mage LV10 to Warlock LV1 and back to have Mage LV 10 again while Warlock will still be LV1)

2) Automatic Chance the Grafic for all Actors when they set they classes - As an example like in an old Final Fantasy that we can have 2 Mages as different actors with the same sprite or in combination with my first wish, like an evolution. I know this can be easily made with a common event, but made this up for every actor can be a pain in the a** ^^"

it would be REALLY awesome, to get this *_*
Hello, thank you for showing intrest in the script.

I didn't have plans to realy expand this and I probably won't.

As for the first thing you point out Yanfly was having a plugin vote to see what plugin they would make next and one of the options was a Class Change Core plugin which I assume is exactly what you want. I could atempt to do such a plugin but I just dont have the time and even if I did Yanfly's would not doubt be superior.

Also I thought about putting it in a note but I didn't think it important but so I clear the part "go from Mage LV10 to Warlock LV1 and back to have Mage LV 10 again while Warlock will still be LV1" RPG Maker MV uses Class based Exp so you can mimic the behavior with the plugin parameters:

keepExp: falseforgetOld: truelearnNew: trueIf you use these settings or the "ChangeClass forgetOld_learnNew <actorId> <classId>" plugin command it will have the desired effect.

As for the second point i might make that as an addon to the plugin or even as a standalone in the future if I have the time but I won't realy promise anything.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Profile Posts

JDgoldvox wrote on Mr. Detective's profile.
hey, could u help me with a problem? basically, How do I delete a character from a map after a cut scene is over? I am really new with RPG maker MV. Please help!
The most rewarding part of making custom body character parts is absolutely not making the masks work. Somebody please put me out of my misery.
Any commercial devs here ever mess with Gamejolt? Been contemplating making my games available there but don't know if it's worth the effort or not.
Social distancing taught me of how much of not a loner I am. Dammit, I miss seeing my friends...
Happy 4th of July all. Anybody have plans? Mine here is staying home away from the virus. Still a nice 3 day weekend.

Forum statistics

Threads
99,262
Messages
963,602
Members
130,856
Latest member
superfluffy
Top