• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[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 11
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