So I've managed to make it that once you learn a skill for a specific subclass, in this case lets say Swordsman, you gain one level for said subclass and you start at level 1. How would I make it so a skill requires seven levels, that is learning 6 other skills, to be unlocked based off subclass level? And how would I go around making certain skills cost more based off subclass level? Like say skills cost 50 at level 1, 100 at level 2, 300 at level 3 etc?
MZ Question about VS Change Class System and Skill Learn System.
Javascript/Plugin SupportAs a note, per the section guidelines, please provide links to the plugins you're asking about so other people can easily look at the documentation.
www.yanfly.moe
Unfortunately, as far as I can see, VisuStella does not tell you in the documentation for the Class Change plugin how to reference an actor's level in different classes.
So for the actual code to put into one of the notetags, you'd have to do some searches to see if anyone has discovered that code, or try asking VisuStella.
www.yanfly.moe
But, again again, the math can't be done without a way to retrieve what the actor's level in that class is.
A partial answer is you'd use the Requirement Conditions notetags.
Skill Learn System VisuStella MZ - Yanfly.moe Wiki
Unfortunately, as far as I can see, VisuStella does not tell you in the documentation for the Class Change plugin how to reference an actor's level in different classes.
So for the actual code to put into one of the notetags, you'd have to do some searches to see if anyone has discovered that code, or try asking VisuStella.
Again, there are Skill Cost notetags:
Skill Learn System VisuStella MZ - Yanfly.moe Wiki
But, again again, the math can't be done without a way to retrieve what the actor's level in that class is.
Sorry, my mistake on that.
I think the function might be classLevel[classid]? This is the code I'm using for leveling up a class level which I found in this thread.
This levels up any subclass level equipped at the 2nd slot. If I change classLevel[classid] to classLevel[4] it only levels up the Swordsman class in the 4th ID slot at the class tab.
On another note is there also a way to check if a certain class is equipped for skill requirements? Like having swordsman equip as a subclass opens up swordsman skills to be learned. If you have wizard equipped as a subclass that would lock you out of learning swordsman skills.
I think the function might be classLevel[classid]? This is the code I'm using for leveling up a class level which I found in this thread.
JavaScript:
<JS On Learn Skill>
let accuBase = 0;
let classid = user._multiclasses[1];
for (let i = user._classLevel[classid]; i < user._classLevel[classid] + 1; i++) {
accuBase += user.expForClassLevel(classid, i + 1);
}
user._exp[user.getMulticlassAtTier(2)?.id] = accuBase;
user.refresh();
</JS On Learn Skill>
This levels up any subclass level equipped at the 2nd slot. If I change classLevel[classid] to classLevel[4] it only levels up the Swordsman class in the 4th ID slot at the class tab.
On another note is there also a way to check if a certain class is equipped for skill requirements? Like having swordsman equip as a subclass opens up swordsman skills to be learned. If you have wizard equipped as a subclass that would lock you out of learning swordsman skills.
That's an array, not a function, but that's not relevant terminology for you 😉
So you would just plug that into the notetags I referenced for you.
Code:
<JS Learn Requirement>
enabled = user._classLevel[4] >= 6;
</JS Learn Requirement>
Code:
user._multiclasses.includes(4)
lol my knowledge of javascript is abysmal. Thank you very much.
Alright just one final question. The system works perfectly for subclasses but I'm using class points as a stand in for levels for the main class. Each actor has their primary class locked and it checks for the actor ID so each actor gaining a skill for their primary class gives them a class point rather than a level up and it works fine. My problem is how to go around making the system check for class points?
It works great for everyone but the main actor. I just need to know the right code for it to check class ponts if possible.
Edit: Nevermind, a little more concentrated search and the correct code is "$gameActors.actor(1).getClassPoints(0);".
JavaScript:
<JS Learn Requirement>
if (user._actorId == 1) {
enabled = $gameActors.actor(1).ClassPoints >= 5;
} else {
enabled = user._classLevel[4] >= 5;
}
</JS Learn Requirement>
It works great for everyone but the main actor. I just need to know the right code for it to check class ponts if possible.
Edit: Nevermind, a little more concentrated search and the correct code is "$gameActors.actor(1).getClassPoints(0);".
Just to point out a few things:
- It's bad practice to access the _actorId property. You should use getter functions when they're provided, so it's more correct to use
- Why are you using
Glad you got it doing what you want.
- It's bad practice to access the _actorId property. You should use getter functions when they're provided, so it's more correct to use
user.actorId()- Why are you using
$gameActors.actor(1) for anything? Once you've established the user's ID is 1, then that's exactly the same thing as just continuing to type userGlad you got it doing what you want.
Original thread: https://forums.rpgmakerweb.com/threads/question-about-vs-change-class-system-and-skill-learn-system.172978/