• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Loop animation

Status
Not open for further replies.
Level 6
Joined
Jul 22, 2009
Messages
214
I'm searching how can I make a unit play the same animation in loop. I want a unit with the warcraft Priest model play his Spell Attack animation. I also want to know how I will be able to stop the loop.
Thanks a lot.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Peon Power!!

Moin moin =)

Well this just very simple way, change the event time to the time of the animation and then:

  • test
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer = (Integer + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Less than 6
        • Then - Actions
          • Animation - Play Priest 0000 <gen>'s spell attack animation
        • Else - Actions
But you should be more specified, you need it just for fun, for a spell or for some other reason?

Greetings and Peace
Dr. Boom
 
Level 6
Joined
Jul 22, 2009
Messages
214
I want a unit play the same animation until something append, the unit is like an NPC who is healing someone and when we will interact with him he have to stop the animation.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Well then again we have couple of choices, but you said hes an NPC's so possible you mean something if a player is interacting to him, then he stop playing the animation?

  • Trig1
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Priest 0000 <gen> is selected by (Picked player)) Equal to False
            • Then - Actions
              • Animation - Play Priest 0000 <gen>'s spell attack animation
            • Else - Actions
              • Animation - Play Priest 0000 <gen>'s stand animation
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use Loop Action:
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Animation - Queue (Triggering unit) attack animation
This will loop the unit's attack animation 5 times

And if you want the unit to stop the loop, just do this:
  • Animation - Play (Triggering unit) stand animation
Full Trigger

  • Looping Animation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Banish
    • Actions
      • Set SavedUnit = (Triggering unit)
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • Animation - Queue SavedUnit's attack animation
  • Stop Animation
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Animation - Play SavedUnit stand animation
Once the Banish is casted, the unit will play its attack animation 100 times (set this to your "estimated infinite amount of time the unit play its spell attack animation") and it can only be stopped by pressing ESC button
Of course trigger above is not MUI but I bet you're not looking for a MUI trigger, right ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
One option is to give the unit modified Channel ability. Fully MUI way with no looping triggers.

Copy and paste Channel.
Set levels to 1 and make it non-hero ability.
Edit Art - Animation names. Make it have two strings. The first one should be spell and the other attack if the animation name is spll attack.
Set follow through time to some large value like 99999. This is how long the unit will repeat the animation.
Give the unit the ability.

Then you can order the unit to start the animation like this for exmple:
  • Untitled Trigger 073
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u = Mountain King 0024 <gen>
      • Custom script: call IssueImmediateOrder(udg_u, "channel")
The "channel" should be the ability's base order id, it's is set to that by default.

When you want to abort the animation, order the unit to stop.

Eventually the follow through time will run out and the unit will stop automatically. You can catch that moment with Unit finishes casting an ability event and order it to start again. 99999 seconds is a long time and you might not need such trigger.
 
Level 6
Joined
Jul 22, 2009
Messages
214
One option is to give the unit modified Channel ability. Fully MUI way with no looping triggers.

Copy and paste Channel.
Set levels to 1 and make it non-hero ability.
Edit Art - Animation names. Make it have two strings. The first one should be spell and the other attack if the animation name is spll attack.
Set follow through time to some large value like 99999. This is how long the unit will repeat the animation.
Give the unit the ability.

Then you can order the unit to start the animation like this for exmple:
  • Untitled Trigger 073
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set u = Mountain King 0024 <gen>
      • Custom script: call IssueImmediateOrder(udg_u, "channel")
The "channel" should be the ability's base order id, it's is set to that by default.

When you want to abort the animation, order the unit to stop.

Eventually the follow through time will run out and the unit will stop automatically. You can catch that moment with Unit finishes casting an ability event and order it to start again. 99999 seconds is a long time and you might not need such trigger.

Thanks man, it's work perfectly and it doesn't require a looping trigger, exactly what I was searching.
+REP
 
Status
Not open for further replies.
Top