MV SRD's timed attacks not working within "whole action"

Hello! recently I've been trying to add more controller support to my game by allowing the player to choose what buttons are displayed during gameplay, and part of that includes changing what images are used for the "wheel" type timed attacks used for most of my game's basic magic spells.

SRD's timed attack wheel plugin doesn't have a plugin command to change the default image used whenever, and the parameters aren't defined in the code so I'm unable to use a script call to change them myself. So in order to achieve this I used some if else statements in yanfly's action sequences in combination with the timed attack action sequence plugin to try and work around this issue by calling the timed attack within dummy skills that correspond to the button display option the player has chosen, as seen below

Spoiler: Single target action sequence
Code:
<Use Timed Attack Action Sequences>

<target action>
if $gameVariables.value(116) === 0
  Timed Attack: 778
else if $gameVariables.value(116) === 1
  Timed Attack: 784
else if $gameVariables.value(116) === 2
  Timed Attack: 790
else
  Timed Attack: 796
end
perform action
motion wait: user
action animation
wait for animation
action effect
death break
</target action>

an issue raised when attempting to do the same thing in a multi-target magic skill however. i know using target action tends to be a bit finicky there so I attempted to do this within whole action, and then leave target action completely empty to prevent anything strange from happening, as seen below.

Spoiler: Multi target action sequence 1
Code:
<whole action>
if $gameVariables.value(116) == 0
  Timed Attack: 779
else if $gameVariables.value(116) == 1
  Timed Attack: 785
else if $gameVariables.value(116) == 2
  Timed Attack: 791
else
  Timed Attack: 797
end
perform action
motion wait: user
action animation
wait for animation
action effect
death break
</whole action>

<target action>
</target action>

this however didn't work as it'd seem to just skip straight to everything after the if/else statement. I then attempted to just use target action and leave whole action alone, which of course did not work, as it caused the whole sequence to trigger once per enemy, which isn't what I'm trying to achieve. I even attempted to try putting my if/else statement in setup action to see if it would work, but it did not, it simply skipped over the timed attack completely and went on to whole action as normal

Spoiler: multi target action sequence 2
Code:
<setup action>
clear battle log
display action
immortal: targets, true
perform start
wait for movement
if $gameVariables.value(116) == 0
  Timed Attack: 779
else if $gameVariables.value(116) == 1
  Timed Attack: 785
else if $gameVariables.value(116) == 2
  Timed Attack: 791
else
  Timed Attack: 797
end
</setup action>

<whole action>
perform action
motion wait: user
action animation
wait for animation
action effect
death break
</whole action>

<target action>
</target action>

Maybe it's just because I'm tired from staying up so late but I'm unable to actually find any way to achieve what I want here, would anyone know how I could get this to do what I want?
Nested conditional branches don't exist in MV's action sequences.

What you can try is:

Code:
if $gameVariables.value(116) === 0
  Timed Attack: 778
  end
if $gameVariables.value(116) === 1
  Timed Attack: 784
  end
if $gameVariables.value(116) === 2
  Timed Attack: 790
  end
if $gameVariables.value(116) === 3
  Timed Attack: 796
  end
Nested conditional branches don't exist in MV's action sequences.
That's true, but what the OP posted isn't nested. if/else if/else does exist in Yanfly's Action Sequences:

1694520647533.png


@DRG Your code is structured correctly. The issue appears to be with the combo plugin you're using to combine these two. When I Googled your issue (always a good first step!), I immediate found this thread describing the exact same problem:

For future reference, the pinned instructions post at the top of this forum says you should provide links to all plugins you mention in your post so that we can easily see what you're using. That SRD plugin to add timed attacks to action sequences probably has a bug/is missing something that would need editing to fix.
Do you also have the Timed Attack Action Sequences plugin installed?


Reading comprehension fail on my part, I'm also doing something similar to you with Timed Attack Circle but upon review, it's within the <target action> block.

I would still try what @SGHarlekin suggested because I have not had luck with else clauses working in action sequences despite the documentation saying they are supported.

And in the end, it may be easiest to make changes to the plugin directly. SRD is not releasing updates to it so it's likely to stay static going forward.

From the Help Section of the Plugin
* Button Image: (Input filename of for in /img/SumRndmDde/tas/) * Ring Image: (Input filename of for in /img/SumRndmDde/tas/) * Target Image: (Input filename of for in /img/SumRndmDde/tas/)

Lines 312-314 in the loadItem() function are where these get set:
this._button = item.button; this._ring = item.ring; this._target = item.target;

So you could overwrite the parameter passing entirely and use your game variables (with a default else condition to fall back on the params).
Do you also have the Timed Attack Action Sequences plugin installed?
The OP says
I used...the timed attack action sequence plugin to try and work around this issue
😉

Otherwise, the single target version shown in the first post would never have worked.
You caught my gaff before I was able to erase my mistake @ATT_Turan … teaches me right for only half reading it while cooking lunch.
That's true, but what the OP posted isn't nested. if/else if/else does exist in Yanfly's Action Sequences:

View attachment 276300

@DRG Your code is structured correctly. The issue appears to be with the combo plugin you're using to combine these two. When I Googled your issue (always a good first step!), I immediate found this thread describing the exact same problem:

For future reference, the pinned instructions post at the top of this forum says you should provide links to all plugins you mention in your post so that we can easily see what you're using. That SRD plugin to add timed attacks to action sequences probably has a bug/is missing something that would need editing to fix.
my apologies, I hadn't used the forums in awhile so linking all the plugins involved slipped my mind, I did however attempt to google my problem, and it's likely that the specific terms I used when googling were incorrect because I didn't find the thread you mentioned. If I had this thread probably would've turned out differently. Thank you for linking me the thread regardless.

Do you also have the Timed Attack Action Sequences plugin installed?


Reading comprehension fail on my part, I'm also doing something similar to you with Timed Attack Circle but upon review, it's within the <target action> block.

I would still try what @SGHarlekin suggested because I have not had luck with else clauses working in action sequences despite the documentation saying they are supported.

And in the end, it may be easiest to make changes to the plugin directly. SRD is not releasing updates to it so it's likely to stay static going forward.

From the Help Section of the Plugin
* Button Image: (Input filename of for in /img/SumRndmDde/tas/) * Ring Image: (Input filename of for in /img/SumRndmDde/tas/) * Target Image: (Input filename of for in /img/SumRndmDde/tas/)

Lines 312-314 in the loadItem() function are where these get set:
this._button = item.button; this._ring = item.ring; this._target = item.target;

So you could overwrite the parameter passing entirely and use your game variables (with a default else condition to fall back on the params).
thank you!
messing with the plugin was my last resort but if that's what it takes, I'll likely try it, at least now I know what exactly I need to do if/when I try that.

After maybe five minutes of work this is what I got, and to my surprise it actually worked first try and as far as I can tell, there's no bugs yet

image.png


Honestly, if I knew how easy it would've been to do this from the start I would've saved so much time.
Regardless of that, Thanks to everyone for offering their solutions and advice!
This thread is being closed due to being solved. I also merged your triple post. If you need it reopened, please report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/srds-timed-attacks-not-working-within-whole-action.161115/