• 🏆 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!

Play Walk Animation?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
Anyone know how to get it to work? Fresh map, completely blank, this trigger:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -walk as An exact match
    • Conditions
    • Actions
      • Animation - Play Peasant 0000 <gen>'s walk animation
No walk animation. It tries to transition into it, but immediately stops. I've even tried editing the model to change the animation name, just to see if it's hard-coded if a unit isn't moving than automatically stop playing walk animation but it still doesn't play. Also tried setting move speed in the animation to 0 and made it non-looping. Still nothing.
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
not sure if you can use run and walk animations that way. I know for a fact that it works for the SetUnitAnimationByIndex(unit, index) function, but that requires you to know under which index is the walk animation.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
That's because of the event.

What? :eekani:
not sure if you can use run and walk animations that way. I know for a fact that it works for the SetUnitAnimationByIndex(unit, index) function, but that requires you to know under which index is the walk animation.

Correct. You can find the index by either using War3ModelViewer or MDLvis.
 
Level 12
Joined
May 20, 2009
Messages
822
Where do I find it? I'm looking at it through War3ModelEditor right now. Under Sequence Manager? Or is it just the number of the sequence in order that they appear? (Like, Stand would be 0 because it's the first animation, attack would be 6, etc)

EDIT: That was it. Okay, so this poses a problem. How would I know what to convert a string to? Like, "walk". That animation is a different index on different models. Just using the index can be a bit confusing, because you'd have to know the index and the only way to know the index is to use a program like MDLX Converter to see the raw MDL data of the model, to see the order the anims come in. (It can show up differently in War3ModelEditor and MDLVis than in the raw data in a text editor)

The reason I'd prefer a string is because I can simply have it be "walk" by default in my system and I won't have to hunt down an index number.

EDIT2: So there's another issue. Abilities seem to trigger an animation, even if they don't actually have any animation under Animation Names. The problem with this is they have a fairly large delay in executing, so I can't instantly trigger animations in my system without my ability resetting the animation. I'm using Channel as a base for my ability. Any ideas for this too?
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
You can not play the walk animation with SetUnitAnimation(), which is what this GUI action converts to.

I don't know why, but I assume it's a bug.
SetUnitAnimationByIndex works.

If it's a bug, it must have to do with the way the frames themselves are parsed and not the animation name or whether the animation is non-looping or has move speed. I edited the walk animation heavily to be exactly like an attack animation, but just playing the walk frames. Still doesn't play.

Also, I still don't have any answers for my other issues.
 
About your other issues: I'm pretty sure you will not like my answers...


1) There is no way to find out the animation index from within the editor or game dynamically. You have to manually build a registry for your models and get the indices from that.

2) This is also a known problem. Unfortunately, no way around retriggering the animations after a delay.
However, setting the animation in the object editor to "stand" will at least make sure it looks somewhat natural without the unit jerking around.
 
Level 12
Joined
May 20, 2009
Messages
822
Well, the problem with #2 is that I can't play my animation through triggers until about after a second has passed. Because I'm making a movement system, that entire second they're just gliding across the ground not playing a moving animation. Because of the way Animation Names in an ability works, I can't have it play the walk animation through the ability either (It seems to use the SetUnitAnimation() function to play the animation).

Modifying all the models to get a functional animation just isn't viable, either. That would be at least 4 or 5 MBs of models I'd have to import into my map. That's just not practical until the map size limit is bumped up in the next patch, and even then that still is a little iffy to do.

It wouldn't be a problem if the abilities weren't slower than triggers. =\

Anyone know of a way to make attachments play animations? That might be the way to get this to work properly.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
Where do I find it? I'm looking at it through War3ModelEditor right now. Under Sequence Manager? Or is it just the number of the sequence in order that they appear? (Like, Stand would be 0 because it's the first animation, attack would be 6, etc)

EDIT: That was it. Okay, so this poses a problem. How would I know what to convert a string to? Like, "walk". That animation is a different index on different models. Just using the index can be a bit confusing, because you'd have to know the index and the only way to know the index is to use a program like MDLX Converter to see the raw MDL data of the model, to see the order the anims come in. (It can show up differently in War3ModelEditor and MDLVis than in the raw data in a text editor)

The reason I'd prefer a string is because I can simply have it be "walk" by default in my system and I won't have to hunt down an index number.
I don't know about War3ModelEditor, but Warcraft3Viewer does show the animations in the order they are indexed, starting with index 0. But as you have pointed out, animations are ordered differently for each unit so there is no simple way of doing this. Only idea I have would be to use hashtable for this - as ParentKey use unit-type ID, as child key use animation name (e.g. walk) and as Value save the index. The problem here is of course that you would have to manually set everything up yourself.

EDIT2: So there's another issue. Abilities seem to trigger an animation, even if they don't actually have any animation under Animation Names. The problem with this is they have a fairly large delay in executing, so I can't instantly trigger animations in my system without my ability resetting the animation. I'm using Channel as a base for my ability. Any ideas for this too?
There was a similar thread regarding this. Another option is to edit the model. Simply copy the walk animation and name it differently like "Spell" or some unique string and then refer to the copied animation instead of standard 'walk'.
 
Level 12
Joined
May 20, 2009
Messages
822
I don't know about War3ModelEditor, but Warcraft3Viewer does show the animations in the order they are indexed, starting with index 0. But as you have pointed out, animations are ordered differently for each unit so there is no simple way of doing this. Only idea I have would be to use hashtable for this - as ParentKey use unit-type ID, as child key use animation name (e.g. walk) and as Value save the index. The problem here is of course that you would have to manually set everything up yourself.


There was a similar thread regarding this. Another option is to edit the model. Simply copy the walk animation and name it differently like "Spell" or some unique string and then refer to the copied animation instead of standard 'walk'.

I didn't check Warcraft3Viewer. It looks like that does indeed order them properly.

As for the second thing, that sucks though. Because that means I'd have to ship my map with 100s of the standard models modified with this and that's not practical until the size limit is increased and probably would still be a mess even if it was. Also I did try this and got no good results out of it.

What exactly are you trying to do?

Maybe this takes us further than discussing stuff that the game can't do.

I think I'll upload my map to show it than tell it.

EDIT: Map added.

Basically, I'm trying to make a fully-functional movement system built mostly out of GUI/JASS (Which the exception of a few abilities, that's impossible to avoid though). This will have several advantages such as having significantly higher speed caps (Already does), easier to modify (I think I did a good job at keeping it clean, but it can probably be cleaned up more), easy to expand upon with new mechanics (Will have tons of things you can just hook right into as I work on the system), and to be all-around useful for map makers that want a bit more control over things they can't normally have with standard movement. This is also just the first part of my current project I'm making that will include a full-featured attack/spell damage system, missiles, turrets, and pathing. The whole idea behind it all is to break the hard-coded nature of all of this stuff in WC3 and add some new useful features. (Such as the mentioned turrets, as well as acceleration and deceleration on movement)
 

Attachments

  • Move System 0.1.w3x
    24.3 KB · Views: 75
Last edited:
The way I solved the walk thing in my Mount system was by actually creating a dummy unit, pausing it, then applying the walk animation via SetUnitAnimationByIndex().

Not sure if that helps, but you can probably tinker around with having a visible dummy unit for every controllable unit and make the original units invisible if you want full control over animations.
 
Level 12
Joined
May 20, 2009
Messages
822
That may work, but will also have some serious performance issues I'd imagine.

I've managed to get it mostly functional now with only one bug:

If you order them to move constantly, the animation resets. While this isn't visible on the actual unit model, you can clearly see it's happening because they leave behind more footprints. I am using the normal move ability now, as well.

EDIT: Adding a new version of the map. Very weird things happen with it's facing and walk animation when the unit covers long distances. No idea why or how.
EDIT2: Pausing and immediately unpausing the unit fixes it, but causes a nearly just as weird bug.
 

Attachments

  • Move System 0.1.w3x
    24.8 KB · Views: 69
Last edited:
I'm not sure if this is still needed by just FYI and for anyone else who stumbles across this later.

This trigger will get you your models animation index.

  • Events
    • Every 2.00 seconds of game time
  • Conditions
  • Actions
    • Game - Send message to (all players) with text: (string(i))
    • Custom Scripts: SetUnitAnimationByIndex(udg_unit, udg_i)
    • Set i = i +1
 
Level 12
Joined
May 20, 2009
Messages
822
I'm not sure if this is still needed by just FYI and for anyone else who stumbles across this later.

This trigger will get you your models animation index.

  • Events
    • Every 2.00 seconds of game time
  • Conditions
  • Actions
    • Game - Send message to (all players) with text: (string(i))
    • Custom Scripts: SetUnitAnimationByIndex(udg_unit, udg_i)
    • Set i = i +1

It'd honestly probably be easier to just have a program like WarCraft 3 Viewer.
 
That may work, but will also have some serious performance issues I'd imagine.

I've managed to get it mostly functional now with only one bug:

If you order them to move constantly, the animation resets. While this isn't visible on the actual unit model, you can clearly see it's happening because they leave behind more footprints. I am using the normal move ability now, as well.

EDIT: Adding a new version of the map. Very weird things happen with it's facing and walk animation when the unit covers long distances. No idea why or how.
EDIT2: Pausing and immediately unpausing the unit fixes it, but causes a nearly just as weird bug.
The problem is that after you use SetUnitX() and SetUnitY(), the facing of the unit will turn towards the target point of the issued move order. I also had that problem with my Mount system.
It can be fixed by simply issuing new move orders always in the direction of the unit's facing. As you build your own movement system, you should always know in which direction the unit looks anyway.

Whats the bug that happens when you pause/unpause?
 
Status
Not open for further replies.
Top