• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Make Heroes play Spell Animation while using Horn of the Clouds

Status
Not open for further replies.
Hello guys,

Is there a way to make Heroes repeatedly play their spell animation while using Horn of the Clouds?
They must loop their spell animation as long as they are casting the ability from the item Horn of the Clouds. If they get interrupted (stunned, cycloned etc...) or die, they immediately stop the animation.

(What if an amphibious Hero like Vashj uses Horn of the Clouds while she's in water? Will she play her spell animation or spell swim animation :con:)

Thank you. :)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Pretty simple. Cloud of Fog is the ability used by the item.

  • use item
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Animation - Play (Triggering unit)'s spell animation
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Animation - Queue (Triggering unit)'s spell animation
  • stop using item
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Animation - Reset (Triggering unit)'s animation
Edit: This should work. You can adjust the "100" in your Loop to a smaller number, it basically tells the game to play the heroes Spell animation 100 times in a row. So if the the Cloud ability only channels for up to 10 seconds, and your heroes Spell animation takes 1 second to finish, then all you would need to do is queue the animation 10 times.

And when it comes to Vashj and her Swim animations, i'm pretty sure those Swim animations are used with "Animation Tags". So if you add the Swim Animation Tag to Vashj then she will automatically play her Spell Swim animation instead of her normal Spell animation.
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Pretty simple. Cloud of Fog is the ability used by the item.

  • use item
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Set unit = (Triggering unit)
      • Animation - Play unit's spell animation
      • Trigger - Turn on animation loop <gen>
  • animation loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Animation - Play unit's spell animation
  • stop using item
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Trigger - Turn off animation loop <gen>
Using a Unit Indexer and two variables you could easily make it MUI.
Variables:
ChannelingHorn = Empty Unit Group
ChannelHornDuration[] = 0.00 (Real)

Then you would need a timer that runs every 0.05 seconds.

So every 0.05 seconds pick every unit in your ChannelingHorn Unit Group and increase their ChannelHornDuration[custom value of picked unit] by 0.05. Then check if their ChannelHornDuration is >= 1.00 (or however long you want the interval to be) and if that's the case then play the picked unit's spell animation and set ChannelHornDuration to 0.00.

Just make sure to remove the unit from the ChannelHorn Unit Group when it stops casting the ability.

Also, make sure to reset the ChannelHornDuration to 0 when you start the effect of the ability or when you stop casting the ability, either is fine.

Finally, add an If statement at the end of our timer to check if ChannelHorn Unit Group is empty, and if it is empty then turn off the timer.
Simple, but not really the best option.
Using a custom script with this native is better, it loops forever, until you want him to stop (reset the unit's animation when unit stops casting the ability).
JASS:
native          SetUnitAnimationByIndex     takes unit whichUnit, integer whichAnimation returns nothing
You just need to figure out which is the correct index of the animation for "spell" animation.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Simple, but not really the best option.
Using a custom script with this native is better, it loops forever, until you want him to stop (reset the unit's animation when unit stops casting the ability).
JASS:
native          SetUnitAnimationByIndex     takes unit whichUnit, integer whichAnimation returns nothing
You just need to figure out which is the correct index of the animation for "spell" animation.

That only played the animation once when I tested it.

Edit: I found a nice fix that should be MUI. Edited my post above.
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
That only played the animation once when I tested it.
...What?

Pretty simple. Cloud of Fog is the ability used by the item.

  • use item
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Animation - Play (Triggering unit)'s spell animation
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Animation - Queue (Triggering unit)'s spell animation
  • stop using item
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Cloud of Fog
    • Actions
      • Animation - Reset (Triggering unit)'s animation
Edit: This should work. You can adjust the "100" in your Loop to a smaller number, it basically tells the game to play the heroes Spell animation 100 times in a row.
No it doesn't, queue animation makes it endless. The loop is unnecessary.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
...What?


No it doesn't, queue animation makes it endless. The loop is unnecessary.

Did you test it out? I tested all of these things out ingame and the only way to get the animation to loop was by either queuing it the way I did or by having a periodic timer that would play the animation.

Note: I'm using patch 1.31. Also I think the Cloud of Fog ability is the cause of the weird interaction.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
I've used this many times, and tested again before the last post, the loop isn't needed. I'm using the lastest patch, 1.31.1 it's live.
That's odd.

Yeah, I think it's 100% a weird interaction with Cloud of Fog. I just tested every single one of your methods, and I know I've used them before in my own work, but they don't seem to work for this ability.
 
Status
Not open for further replies.
Top