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

Making a unit that is standing play their walk animation

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a custom movement system. I want a unit to "walk" while I move it around using the SetUnitX and SetUnitY custom scripts.

Whenever I use the action to play the unit's animation, it twitches as if starting the walk animation, but then immediately stops and plays one of their stand animations. I think this is because the unit isn't actually walking. Is there a way to override the stand animation that appears to play automatically?
 
You should try setting the unit's animation by index instead:
  • Set TempUnit = (Triggering unit)
  • Set TempIndex = 5
  • Custom script: call SetUnitAnimationByIndex(udg_TempUnit, udg_TempIndex)
That is just an example. You'll have to mess around with different indexes to figure out which one refers to the "walk" animation. Or you can open the MDL and count it manually (indices start at 0). e.g. The first animation listed has an index of 0, the next has an index of 1, and so on.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Beautiful! Works great, thanks. Though the animations in the model aren't always listed in order. I was looking for the walk animation of the WolfRider.mdx model (Orc raider). It's animation 2. I looked at the sequence manager of the model editor and looked at when each started. Anyway, for those who find this in the future, try trial and error unless you're use to editing models.

Thanks Purge! I can't give +rep again yet, but I'll try to remember for later.
 
You can also opt to edit the model in magos to switch the stand and walk animations (as in switch the animation names)...

Also, I think if there's only one walk animation, you can actually use the set animation that uses the animation name rather than index... the set by index is used more on custom animation names and if an animation name has different variations like "attack - 1, attack - 2" etc, where using "attack - 1" as the string doesn't really work...
 
Beautiful! Works great, thanks. Though the animations in the model aren't always listed in order. I was looking for the walk animation of the WolfRider.mdx model (Orc raider). It's animation 2. I looked at the sequence manager of the model editor and looked at when each started. Anyway, for those who find this in the future, try trial and error unless you're use to editing models.

Thanks Purge! I can't give +rep again yet, but I'll try to remember for later.

Oh. I don't think Magos' model editor lists the sequences in order, though. (though, I could be wrong--I haven't checked) I know that his editor doesn't list geosets in order, so perhaps it is the same case with the sequences. MDLVis lists them in order for sure. I'm very glad you got it working though. :)
 
Status
Not open for further replies.
Top