Oh, nevermind. It seems it was $gameParty.leader().classLevel(id).
Thank you anyways!
Now I'm stuck with another thing: I would like to check with a "Conditional Branch" Event whether actor 1 has already unlocked subclass x.
How can I do that?
Thank you so much!
And one final issue:
How can I use a script to change a certain subclasses' level?
It works!!!! Great!!! Thank you 1000000000000000000 times!!!!
So now the very last thing I need, would be a script to uplevel a subclass.
I was trying to set class ID 16, to level 14, by using a script call:
$gameVariables.setValue($gameActors.actor(1).classLevel(16), 14);
But nothing happened....
But is there a way to level up a subclass that's not currently activated? I would like to set an initial level whenever a new class is unlocked.
Could it have something to do with this?
Yanfly.Subclass.Game_Actor_gainExp = Game_Actor.prototype.gainExp;
Game_Actor.prototype.gainExp = function(exp) {
this.gainExpSubclass(exp);
Yanfly.Subclass.Game_Actor_gainExp.call(this, exp);
};
Game_Actor.prototype.gainExpSubclass = function(exp) {
if (!this.subclass()) return;
exp *= Yanfly.Param.SubclassExp;
var curExp = this._exp[this._subclassId] || 0;
var newExp = curExp + Math.round(exp * this.finalExpRate());
this._exp[this._subclassId] = Math.max(newExp, 0);
};
So it seems the experience is saved in $gameActors.actor(1)._exp[1]. This is the experience for class 1.
But how can I set this value = a number, like 10?
Try $gameActors.actor(1)._exp[1] = 10;
YES!!!!!!!!! It works!!!!!!!! Awesome. Amazing!
Is there also a way to do the same just with the class' level?
Maybe something in here?
Game_Actor.prototype.subclassParamBase = function(paramId) {
if (!this.subclass()) return 0;
var rate = Yanfly.Subclass.Param[paramId];
if (!rate) return 0;
if (this.subclass().baseParamFormula) {
var formula = this.subclass().baseParamFormula[paramId];
if (formula !== '') {
return this.classBaseParamFormula(formula, paramId) * rate;
}
}
var level = this.classLevel(this._subclassId);
if (level > 99) {
var i = this.subclass().params[paramId][99];
var j = this.subclass().params[paramId][98];
i += (i - j) * (level - 99);
var value = i;
} else {
var value = this.subclass().params[paramId][level];
}
return value * rate;
};
Nah, that's just for the base parameters.
Does this not work?
$gameActors.actor(ACTOR_ID)._exp[CLASS_ID] = 10;
Yes that one works!!! However I would need another one so I can set the level directly instead of the exp...
$gameActors.actor(ACTOR_ID).changeLevel(x);
It works, but not for the subclasses unfortunately, but I will find a way around it using the experience.
Thank you so much for your help!!! How can I ever thank you for this!