Yanfly Action Sequences Problem

I'm having an issue making an ability work in my game ( Yanfly Battle Action Sequences ) without throwing an error and was hoping I might be able to get some assistance on how to fix it.

Basically, I have an ability that effects the entire team, but I want it to play the animation on each team member a few seconds apart instead of playing all at once. This creates for a more dramatic appearance and sound.

The issue I'm running into, is the spell works perfectly fine if you have a full party, but because of the code if you have a full party it throws an error because it cannot find the existing actors.
Is there anyway to create a break in the spell/event so that if I don't currently have an actor 1, 2, or 3, that it skips them instead of erroring and crashing?

Thanks in advance!

<Target Action>

<Cast Animation: 124>

perform action

motion wait: user

wait for animation

action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action animation: actor 2

wait: 25

action animation: actor 3

wait: 25

action effect: actors
Do you want the animation to be played on each of them one by one, or would you be okay for it to do it's thing on them all at once?

If you choose the latter, then try using this call instead:

action animation: actors

^ That will play the animation on each of the ALIVE actors.
Have you tried using an if..then, and tracking your party size elsewhere in a variable?

Let's say the variable is number "12"

 

<Cast Animation: 124>

perform action

motion wait: user

wait for animation
If $gameVariables.value(12) >= 4
action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action animation: actor 2

wait: 25

action animation: actor 3

wait: 25

action effect: actors

else if $gameVariables.value(12) == 3
action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action animation: actor 2

wait: 25

action effect: actors

else if $gameVariables.value(12) == 2
action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action effect: actors

else
action animation: actor 0

wait: 25

action effect: actors
end

[Or something to that effect, I /think/ I have the Syntax right]
[This of course, won't account for deadness, you'll need something else for that.]
Have you tried using an if..then, and tracking your party size elsewhere in a variable?

Let's say the variable is number "12"

<Cast Animation: 124>

perform action

motion wait: user

wait for animation

If $gameVariables.value(12) >= 4

action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action animation: actor 2

wait: 25

action animation: actor 3

wait: 25

action effect: actors

else if $gameVariables.value(12) == 3

action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action animation: actor 2

wait: 25

action effect: actors

else if $gameVariables.value(12) == 2

action animation: actor 0

wait: 25

action animation: actor 1

wait: 25

action effect: actors

else

action animation: actor 0

wait: 25

action effect: actors

end

[Or something to that effect, I /think/ I have the Syntax right]

[This of course, won't account for deadness, you'll need something else for that.]
This unfortunately still isn't working properly, but it has gotten me a step closer.

The script still throws an error, unless I'm doing something wrong.

Any suggestions? 🙁

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequences-problem.48964/