[SOLVED] All-Target Skills animation delay

Hey there, everybody!!
Hope you're doing great.

Haven't been around for a while, but I'm slowly getting back to my project, hehe.

Today I wanted to ask if anyone knows of a way to make the animations of skills targeting all enemies appear with a small delay, one after the other, instead of all animations popping up at the same time on all enemies, which doesn't look great.

In this case, I'm referring specifically to skills that have an assigned animation that's originally meant for a single target, meaning, they are set to appear over the enemy, not on a specific part of the screen.

Example:
Spoiler: Casting Fire on all enemies
Fire.jpg
See how the animations appear all at the same time? I'd really like to have them pop up in succession instead; say, after the 1st animation starts, wait for 10-20 frames, and then the 2nd one starts, and then the next, and then the next.

I'm using Tankentai Side Battle System 3.4e, no ATB options
I'll leave a Demo attached that's set up to test this. It has a clean project with this battle system mentioned, and one additional script I'm using that allows me to change the scope of a skill from "Single Target" to "Target All Enemies" by pressing "Shift". I believe this shouldn't have an impact on the solution, but just in case 🙂


That's it! Any lights on this would be deeply appreciated.\
Thanks for reading and have a nice day!!
If someone finds a solution or an answer to this I would love ot hear as I am looking for something similiar. As the animations playing at the same time on everyone is kinda goofy.
Bumpy bump!
no one will ever help with this because currently no one can help at all.
the problem is
I am using a script that allows you to make single-target skills be able to target all enemies by pressing shift;
You need to give a link to that script before anyone can tell you how to change it for a different sequence.
Piling on to what Andar said, at least in the default battle system I am pretty sure there already should be a 20 frame delay in place, unless the animations position is set to "Screen" (in which case it is just shown once for all targets).

Does what you describe also happen if you set your skill to target "All Enemies" by default? In which case, what battle system do you use? Or can someone confirm this actually is an issue with VXs default battle system with no scripts added? (In which case it seems like a bug)
Hey all.

I'm using the latest version of Tankentai Sideview Battle System (3.4). I've been using VX since forever and, at a certain point, I moved from Tankentai SBS 3.3 to 3.4.

I'm pretty sure this happens on a clean project with Tankentai SBS as well, as I've tested it.

I believe a tweak to the original methods would do the trick, as the script just changes the scope (from "single target" to "all enemies"), without messing with the original array, but I'm gonna provide the script as soon as I get home! Teehee! 🙂
@Opozorilo I wrote LINK, not name the script.

whoever helps you need to check the code on how that script work, and you (as the one wanting free help) should do everything to make it easier for the people helping you, not expecting them to search the internet for info you already have.
Not an expert when it comes to that battle system even though I've used it at some point, so I might be off...

I think the easiest method to do this might be to use the "Process Skill" key. The default configuration has a sequence "SKILL_ALL" that demonstrates this:
Ruby:
  # "SKILL_ALL" - Example of how to use "Process Skill" and
  #              "Process Skill End" within Action Sequences. Used by the Float
  #              All spell in the demo.                 
  "SKILL_ALL"=> ["STEP_FORWARD","CAST_ANIMATION","WPN_SWING_UNDER","WPN_RAISED",
                          "Process Skill","WPN_SWING_V","DAMAGE_ANIM","24",
                          "Process Skill End","Can Collapse","RESET"],

Right now I see no easy way to wait for the animations to finish without manually measuring wait command, so if you need that this might be a quick and dirty way to do that (Would definitely recommend cleaning up the "instance_variable_get" instances if more use cases arise):
Spoiler
Ruby:
N01::ACTION.update({
 
  # Slightly altered "SKILL_ALL" example that waits for animations to finish:
  "INDIVIDUAL_SKILL_USE"  => [
    # Anime Keys
    "STEP_FORWARD",     # Step forward from current position
    "STAND_POSE",       # Play wait pose (replaces the pose "STEP_FORWARD" used)
    "CAST_ANIMATION",   # Play cast animation on self
    "WPN_SWING_UNDER",  # Swing weapon (this does not do damage!)
    "WPN_RAISED",       # Swing weapon (in a different way)
    "WPN_SWING_V",      # Swing weapon (in another different way)
 
    "Process Skill",    # Repeat the following for each individual target
    "DAMAGE_ANIM",      # Play skill/weapon/item animation
    "10",               # Wait a fixed period before the next move
    "Process Skill End",# Repeat above
 
    "Wait for Animations",  # Wait for battle animations to finish (NEW)
    "Can Collapse",
    "4",
 
    "RESET"             # Return to original battle coordinates if not done
  ],
 
})

N01::ANIME.update({
 
  # Wait out the remaining duration of the active animations:
  "Wait for Animations" => ["script", "wait_for_animations"],
 
})

class Sprite_Battler
 
  def wait_for_animations
    # Dirty approach to get the remaining animation duration of sprites:
    return  unless $scene.is_a?(Scene_Battle)
    spriteset = $scene.instance_variable_get(:@spriteset)
    return  unless spriteset
    @wait = [:@actor_sprites, :@enemy_sprites].map { |symbol|
      spriteset.instance_variable_get(symbol)
    }.flatten.map { |sprite|
      sprite.animation? ? sprite.instance_variable_get(:@animation_duration) : 0
    }.max || 0
  end
end

Edit: Code fix
I think the easiest method to do this might be to use the "Process Skill" key.
Hey Fen! Thanks a lot for your input, I think we're really on to something here!
I tried it out and the animations start popping up smoothly with those 10 frames of delay you set in the example; however, at the end I get his error screen (with or without the "Target All Script):

Spoiler: Error Screen
ERROR.jpg

While making my game, I've played around with multiple scripts and have been able to tweak many things, but to be honest, as of the moment I'm kinda clueless as to how could I fix this, haha. I'll keep playing around for a bit and see what happens.

In the meantime, if anyone sees this, please let us know if you're able to think of a way we could potentially fix this 🙂


Thanks in advance for the help!
Ah, my bad.

I didn't have the VX installed and apparently I messed up when copying over the script data.
Apparently VXs Ruby version does not yet support flatten(0), but you can replace it with flatten here.

Fixed the code above, and sorry for that.
You, sir, have been very helpful, thank you! This has, for the most part, solved my issue 🙂

Though there are still some limitations -mostly when it comes to skills with long animations and multiple damage hits/instances (since we need to wait for the 1st animation's last damage hit to trigger in order to start processing the skill on the next enemy target, making the whole process too long)- this works flawlessly for short animations. The rest is for me to figure out.

I was not aware that the "process skill" function could be used like this. I'm pretty sure that, after playing around for a bit with this and other functions such as skill links, target modifications, etc., I'll be able to find a workaround for those long-animation skills.

Thanks again, Another Fen. I appreciate your help and will to share your knowledge under a possitive light. This topic is solved and can be closed now.

Good day everyone!

Original thread: https://forums.rpgmakerweb.com/threads/solved-all-target-skills-animation-delay.154536/