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

[Trigger] Animation related problem

Status
Not open for further replies.
Level 3
Joined
Oct 6, 2007
Messages
43
I have made a charge ability that moves unit periodically towards point for 1 second. But the problem is here that the hero just moves forward and plays no animation and when I put Animation - Play units walk animation in the trigger, the unit still just stands and keeps moving forward.
 
Level 3
Joined
May 2, 2008
Messages
41
Some more details about your trigger would be nice
It makes it a lot easyer to help if we can see it instead of having to imagine it
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
You need to use a custom script line:

  • Set YourUnit = ...
  • Custom script: call SetUnitAnimationByIndex(udg_YourUnit, <animation id>)
You have to check the unit's walk animation id. You can get it by converting that unit's mdx file to mdl, open it in notepad, search the "sequences" part and find "walk", the first animation listed there is 0, then it goes 1, 2, 3.... count until you get to the "walk" animation and that is the animation id. You just put it instead of the "<animation id>".

The variable doesn't have to be named YourUnit, you can name it whatever you want, but change that part after udg_ to the new variable name as well.

If anything's not clear, I can explain further.
 
Level 6
Joined
Aug 22, 2005
Messages
113
You need to use a custom script line:

  • Set YourUnit = ...
  • Custom script: call SetUnitAnimationByIndex(udg_YourUnit, <animation id>)
You have to check the unit's walk animation id. You can get it by converting that unit's mdx file to mdl, open it in notepad, search the "sequences" part and find "walk", the first animation listed there is 0, then it goes 1, 2, 3.... count until you get to the "walk" animation and that is the animation id. You just put it instead of the "<animation id>".

The variable doesn't have to be named YourUnit, you can name it whatever you want, but change that part after udg_ to the new variable name as well.

If anything's not clear, I can explain further.

Do you set the animation that way after you move it, or before?
 
Level 12
Joined
Mar 26, 2005
Messages
790
I am sure you dont need to search in notepad.

Usually it is in order like it shows in the left panel of the WE.

like
stand
stand - 1
attack
attack - 1
attack - 2
walk

so ID should be 5
 
Status
Not open for further replies.
Top