Animations, experiments, and various questions. (+rep)

Status
Not open for further replies.
Level 3
Joined
Dec 29, 2010
Messages
40
Basicly I've been having strong animation problems. I've been trying to replicate orgrimmar recently, and I'm making the map more dynamic by making units animate.

Basicly, here are my problems:

1. I tried to animate a peon with the talk-gesture animation using the animation-play unit's *insert* animation. I tried all sorts of tags, such as stand talk gesture, talk, talk gesture, stand talk, NONE work. I don't need it on any events, just on map initialization, peons play the talk gesture animation.

2. I tried giving the peasant his attack -2 animation. After 30 minutes of attempts of all sorts, the best result I got was playing the animation ONCE then stopping fully. I need help not only playing this animation, but looping too.

3. I made an experiment after I realised the peasant's attack animations don't play. All his others work, even the decay one, but with the same trigger the attack one, and the -2 one doesn't. I tried with every human unit, none play the attack animation. What's up with that? Is there a certain script for animating attack animations?


I beg you, help me out, I've been having these problems for such a long time I'm raging every minute :ogre_rage:

+rep will be given to those that help me :thumbs_up:
 
Use SetUnitAnimationByIndex(whichunit, index). If you are not familiar with this function, it is used to call any animation the model has; example of usage:
  • Set Unit1 = Peon 0001 <gen>
  • Custom script: call SetUnitAnimationByIndex (udg_Unit1, 2)
Change "2" to the number of the desired animation. Each animation is linked to a number, starting from 0. If a unit has seven animations in general, they will vary from 0 to 6.

Attack - 2 animation: looping as in a cinematic or constantly attack with Attack - 2 animation?
 
Since Pharaoh_ already told the main idea, I'll elaborate subject a bit to make it cleared for you.
  • Custom script: call SetUnitAnimationByIndex (udg_Unit1, AnimNumber)
requires two variables, unit and integer, where integer refers to given animation number.

If you dont know the numbers of animation use this:
  • init
    • Events
      • Time - Every 2 seconds of game time
    • Conditions
    • Actions
      • Set Unit1 = Peon 0001 <gen>
      • Custom script: call SetUnitAnimationByIndex (udg_Unit1, i)
      • Game - Display to (All players) message (String(i))
      • Set i = (i + 1)
'i' - is an integer variable, and with its help you can check which number refers to Attack 2 animation.

Now, you should know which function needs to be used and animating units shouldn't be a problem for you anymore.
For looping use:
  • init
    • Events
      • Time - Every X seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex (udg_Unit1, AnimNumber)
Where X is the duration of given animation. You can check it in world editor or model editor, after all you can always leave that and just enter period between 1-2 seconds
 
Level 3
Joined
Dec 29, 2010
Messages
40
Since Pharaoh_ already told the main idea, I'll elaborate subject a bit to make it cleared for you.
  • Custom script: call SetUnitAnimationByIndex (udg_Unit1, AnimNumber)
requires two variables, unit and integer, where integer refers to given animation number.

If you dont know the numbers of animation use this:
  • init
    • Events
      • Time - Every 2 seconds of game time
    • Conditions
    • Actions
      • Set Unit1 = Peon 0001 <gen>
      • Custom script: call SetUnitAnimationByIndex (udg_Unit1, i)
      • Game - Display to (All players) message (String(i))
      • Set i = (i + 1)
'i' - is an integer variable, and with its help you can check which number refers to Attack 2 animation.

Now, you should know which function needs to be used and animating units shouldn't be a problem for you anymore.
For looping use:
  • init
    • Events
      • Time - Every X seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex (udg_Unit1, AnimNumber)
Where X is the duration of given animation. You can check it in world editor or model editor, after all you can always leave that and just enter period between 1-2 seconds

See, that was something I really wish I knew :vw_wtf:

+rep to both, thanks alot.
 
Status
Not open for further replies.
Top