MZ Force a Follow Up Skill to be used based on Actor's Current Class

Good evening fam,

It's that time of the week where I crowdsource a solution for yet another unnecessarily complicated part of my games skill system!! (Crowd cheers)

Next up.
Using either VisuStellas Battle Core, Fomars Follow Up Skills Common Events, or maybe even some plugin creation/alterations:

I am looking for a way to use a single skill to essention an actor has in their skill list lead directly to another skill in battle depending on their class.

Ex:

Actor uses Skill: If Actor is Class A Then use Skill 1, Else use Skill 2.

At least initially there would only be one specific condition to look for but I would love the option to have "Else If" to check for another class before settingly for the "default" skill that anyone else would use.



I've had luck doing this sort of check to add States But I can't seem to get this to work using <JS Pre or Post> note tags force skill use to save my life.

Any help is greatly appreciated!
From looking quickly at the thread for Fomar's Follow Up Skills, the following notetag might work:

<followup: if (user._classId == ID){1} else {2}>

Replace 'ID' with the class ID you're checking for. Replace 1 with the ID of the skill you want to be used if the user's class matches the ID. Replace the 2 with the alternative skill to be used when the class ID does not match.

I don't fully understand the last part of what you're trying to do but if you're looking to check for an additional class, try this:

<followup: if (user._classId == ID){1} else if (user._classId == ID2) {2} else {3}>

If this works as intended, it would check the user for the first class ID, if it matched, the skill ID matching the first provided skill would be used.

If it was not a match, the second class ID would be checked. If the second class ID matched the user's class, the second provided skill would be used.

If the second class ID was not a match, it would use the final provided skill by default.

Let me know if this works for you.
Hey hey
From looking quickly at the thread for Fomar's Follow Up Skills, the following notetag might work:

<followup: if (user._classId == ID){1} else {2}>
This is similar to what I initial built out except I used a.actor or just actor instead of user. Unfortunately got the same Reference error when attempting to use the skill

1662875965312.png


1662875977573.png


1662875993366.png
Okay, I'll take a look at the plugin code in Monday and see what's going on.
Okay, I'll take a look at the plugin code in Monday and see what's going on.
No rush at all.

I think I may have found at least part of what was needed. Fomar uses a lot of "this" variables for his(her?) plugins.

I replaced user with this and the follow note tag up gives me the "else" result.

Going to keep playing around with it a bit
@Puppet Knight Okay, I think I have a working solution. You'll have to add a couple lines into the plugin.

Copy this code:
Code:
    // Reference to skill user added for Puppet Knight by ThreeSixNine
    let user = this._subject;
Add a blank line at line 42. Do this by going to the end of line 41 and simply pressing enter. Then paste the above code into the blank line.

This addition will allow you to reference the user of the skill in the notetag, enabling the notetag provided before.

Please note that the cost of the follow-up skill must still be met to activate the skill. Plan accordingly when setting up your follow-ups.

Let me know if you have any questions.
No questions at all. I really need to buckledown on my JS though with these simple solutions xD.


It worked! And:

I don't fully understand the last part of what you're trying to do but if you're looking to check for an additional class, try this:

<followup: if (user._classId == ID){1} else if (user._classId == ID2) {2} else {3}>

This did the trick for additional classes in note tags! I almost thought it didn't but its cause I made the follow up skills MP cost higher than I realized haha. Now to just figure a way to permanently add traits after the initial skill is learned without it getting crazy/too many switches.


Problem Solved and improved upon! thanks a ton @ThreeSixNine

Original thread: https://forums.rpgmakerweb.com/threads/force-a-follow-up-skill-to-be-used-based-on-actors-current-class.151209/