Hey guys, I'm sure a lot of you use Yanfly's Class Change Core plugin which gives actors multiple classes.
Now I'm trying to figure out a way how to get the level of an unlocked, but currently inactive class.
I can only get the amount of experience of that class by using:
And I can check if the actor has the class unlocked:
But I would need to get the script call for the level of each unlocked class an actor has, and store it in a variable...
Anyone know how to do this? In the plugin, I found the following, but I still can't seem to figure it out:
EDIT: Wow, I figured it out just after posting the thread.
The solution was
$gameActors.actor(1).classLevel(classId)
I simply had a typo so that's why it wouldn't want to work.
Now I'm trying to figure out a way how to get the level of an unlocked, but currently inactive class.
I can only get the amount of experience of that class by using:
Code:
$gameActors.actor(1)._exp[classId]
And I can check if the actor has the class unlocked:
Code:
$gameActors.actor(1)._unlockedClasses.contains(classId)
But I would need to get the script call for the level of each unlocked class an actor has, and store it in a variable...
Anyone know how to do this? In the plugin, I found the following, but I still can't seem to figure it out:
Code:
Game_Actor.prototype.checkLevelUnlockedClasses = function() {
for (var i = 0; i < $dataClasses.length; ++i) {
var item = $dataClasses[i];
if (!item) continue;
if (this._unlockedClasses.contains(item.id)) continue;
if (Yanfly.Util.isEmptyObj(item.levelUnlockRequirements)) continue;
if (!this.classUnlockLevelRequirementsMet(item)) continue;
this.unlockClass(item.id);
}
};
Game_Actor.prototype.classUnlockLevelRequirementsMet = function(item) {
var classId;
for (classId in item.levelUnlockRequirements) {
var level = item.levelUnlockRequirements[classId];
if (this.classLevel(classId) < level) return false;
}
return true;
};
Window_ClassList.prototype.drawClassLevel = function(item, x, y, width) {
var level = Yanfly.Util.toGroup(this._actor.classLevel(item.id));
var fmt = Yanfly.Param.CCCLvFmt;
var text = fmt.format(level);
this.resetFontSettings();
this.changeTextColor(this.normalColor());
this.contents.fontSize = Yanfly.Param.CCCLvFontSize;
this.drawText(text, x, y, width, 'right');
};
EDIT: Wow, I figured it out just after posting the thread.
The solution was
$gameActors.actor(1).classLevel(classId)
I simply had a typo so that's why it wouldn't want to work.