MV Call current Actor's Class in YanFly Action Sequence?

Hello!

I'm trying to do something I would have thought would be fairly simple but is giving me trouble.

Simply put, I want to use YanFly's action sequence - combined with SergeofBIBEK's "Nested If" plugin, to have magic skills detect the user's class, and change the casting animation depending on what class they are.

I already know this doesn't work but it probably serves to illustrate what I mean:

if user.currentClass() = 3;
<Cast Animation: 128>
else

<Cast Animation: 149>

Thanks!
That is not the correct syntax for an action sequence. You need to have all of the action sequence commands inside one of the notetags that delineates a phase of the skill - <setup action> <target action> etc.

Furthermore, if you do correctly have those notetags but you didn't show it in your post, you can never nest notetags - putting <Cast Animation> inside of something else can't do anything.

You would have to use the appropriate action sequence command to display the animation.

Next, currentClass() returns a Class object, not a number. You'd need to check the ID property of that Class.

Finally, = sets a variable equal to a variable. == is for checking whether two values are already equal.

So you would need to do something like:
Code:
<setup action>
if user.currentClass().id == 3
    animation 128: user
else
    animation 149: user
end
wait for animation
</setup action>
That is not the correct syntax for an action sequence. You need to have all of the action sequence commands inside one of the notetags that delineates a phase of the skill - <setup action> <target action> etc.

Furthermore, if you do correctly have those notetags but you didn't show it in your post, you can never nest notetags - putting <Cast Animation> inside of something else can't do anything.

You would have to use the appropriate action sequence command to display the animation.

Next, currentClass() returns a Class object, not a number. You'd need to check the ID property of that Class.

Finally, = sets a variable equal to a variable. == is for checking whether two values are already equal.

So you would need to do something like:
Code:
<setup action>
if user.currentClass().id == 3
    animation 128: user
else
    animation 149: user
end
wait for animation
</setup action>
Apologies I should have clarified; the <Cast Animation> comes from the Battle Engire Core, which by itself overrides the casting animation to whatever is specified. But I take it that does not work within an action sequence, which I suppose makes some sense.

Knowing that I need the ".id" and the difference between "=" and "==" is incredibly useful. Something I should have already known. That's more than a little embarrassing, haha.

All that said, your code worked perfectly, thank you so much. I knew the answer would be simple and I was just not seeing it. Thanks again!
Apologies I should have clarified; the <Cast Animation> comes from the Battle Engire Core, which by itself overrides the casting animation to whatever is specified.
I know where it comes from, but my original statement stands - it has nothing to do specifically with action sequences, you can never nest notetags inside of each other. It just doesn't work.

Glad it works for you, good luck with your project.
I know where it comes from, but my original statement stands - it has nothing to do specifically with action sequences, you can never nest notetags inside of each other. It just doesn't work.

Glad it works for you, good luck with your project.
Ah understood; sorry, thought there was a disconnect there. That's my bad.
But that makes sense, and is another thing I can keep in mind going forward!

Thanks again for the help.

Original thread: https://forums.rpgmakerweb.com/threads/call-current-actors-class-in-yanfly-action-sequence.159219/