• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Some questions on animation

Status
Not open for further replies.
Level 12
Joined
Sep 28, 2012
Messages
277
I have a few questions I've never been able to answer for myself all these years of working on Warcraft III maps. I've made workarounds, but I think it's time to answer them once and for all. Sorry if there's already a tutorial on this somewhere on here; I couldn't find one. The questions are these:
  1. How do you make a unit instantly do an animation one time? "Play" animation begins an endless loop if the animation is looping, and if it's not looping, it plays once and then the unit freezes their animation. And the "Queue" animation action doesn't trigger immediately; it waits till their current animation is over and then fires. Is there a way to understand these better or just animate units more easily without having to say "Play animation, wait X seconds (where X is the exact length of time of the animation), reset unit animation"?
  2. Is there a way to stop a unit from doing its walk animation while walking? For example, making units like chess pieces that slide forward still doing their stand animation but not their walking one?
  3. Why do animations sometimes simply not work? Are there factors that cause them to not fire even if you put in the correct name of their animation wired to an ability or a trigger? Are there common mistakes mapmakers make in this regard that I might be making? Example: I make a trigger to make the Crypt Lord do his "morph" animation and instead he does his "morph defend" animation.
Help is appreciated as always!
 
Last edited:
Level 15
Joined
Mar 25, 2016
Messages
1,327
I made spoilers, because the text is so long.
1.
If you take a look at the JASS code for
  • Animation - Play unit's stand animation
and
  • Animation - Reset unit's animation
you can see, that reset animation is exactly the same as playing the stand animation.
JASS:
    call SetUnitAnimation( whichUnit, "stand" )
    call ResetUnitAnimation( whichUnit )
            |
            |
            \--->   function ResetUnitAnimation takes unit whichUnit returns nothing
                    call SetUnitAnimation(whichUnit, "stand")
                    endfunction

I think animation are strongly connected to the model. Some animations will loop, while others won't.
Stand for example will loop. Otherwise reset animation would also freeze the animation at some point.

I would do it with timers, but they are only really usable in JASS, so in GUI it's not that easy.
I could write you a small function, you can call with:
  • Custom script: call SingleAnimation(udg_yourunit, "attack")
udg_yourunit would be the unit to play the animation and after that you write the animation name.
2.
If you set walk and run speed to 0 in the object editor and use
  • Animation - Change Crypt Lord 0001 <gen>'s animation speed to 0.00% of its original speed
to freeze the animation even if it is walking.
Apparently only the trigger does not work.

However this does not really work, if you want the unit to have other animation like attack, spell, ...

Also with this method the unit will make tons of footprints.

Triggering the movement completely might work better in terms of animation, but is a lot of work to make it good.

Maybe you could use a dummy model. Your original unit will be invisible by using
  • Animation - Change Crypt Lord 0001 <gen>'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
It still needs to have the model, so you can click on it.

A dummy unit (with locust) is always at the same point. This way you don't have to care about the animations of the original unit.

I don't know if there are some side effects with making the unit invisible.
It could be, that the portrait of the unit is invisible and effect, that are attached to it.
Also buffs would be on weird positions, because they would not be attached to the visible unit, but the invisible.

I think the best way here would be to edit the model in some way, but I don't know anyhing about modeling.
3.
I had no problem with this one. Maybe your unit currently had the "defend" animation tag, because it is using defend for example.
This could help:
  • Animation - Remove the defend animation tag to Crypt Lord 0001 <gen>
 
Level 12
Joined
Sep 28, 2012
Messages
277
1. So in other words, I could "play" an animation and immediately after that "queue" the stand animation? That sounds promising...
2. Long story short, probably not then, eh?
3. I ended up having to use JASS function to play his animation 8, since for some reason it just kept interpreting him as playing the Morph Defend animation instead of just Morph. Maybe some things are just glitched in the World Editor.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
1. So in other words, I could "play" an animation and immediately after that "queue" the stand animation? That sounds promising...
It might actually work. I have not though about this, but you could try it.
2. Long story short, probably not then, eh?
If you want it to be permanent, you can easily edit the model. I tried it and it was actually quite simple. Renaming the walk animation seems to work.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Try this map.
The crypt lord uses his channel animation (I essentially edited the walk animation to have the same values as the channel animation).
The knight uses no walk animation at all.
 

Attachments

  • NoWalkAnim.w3x
    319.1 KB · Views: 41
Level 15
Joined
Mar 25, 2016
Messages
1,327
War3 Model Editor
It's a simple model editor. Under Window -> Sequence manage you can edit animations. I just copied everything I found under channel into walk.

To edit a model you first need to extract it. You can either use a mpq tool or warcraft 3 viewer, which I used.
edit: apparently the model editor has also a mpq browser
 
Level 12
Joined
Sep 28, 2012
Messages
277
Interesting. Probably not something I'd have the patience to tinker around with, especially since I have bad enough luck with importing models as it is. But thanks! Glad to know it's possible. And maybe I'll try out a model editor sometime. What's the program actually called?
 
Status
Not open for further replies.
Top