• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to make a unit use one animation

Status
Not open for further replies.
Hey Trigger thank you for the offer, I'll pm him now, is there no way to do it via triggers or unit editor though? :(
 
Just make a trigger:

Event: Unit enters playable map area
Condition: Unit type of triggering unit = your unit
Action: Disable attack animations 1 + 2 for triggering unit

I don't see a problem there.
 
@Just_Spectating: i can't find this alternate animations field in the object editor, what editor version are you using?
 
@Armenian Beagle: How do you copy the animations one by one? when i import the model the texture, model and animations kinda come in one package xD
 
meOme: I got it now, thank you so much :P, seems a lot easier than i thought it would be :D
 
meOme i just made the trigger but for some reason it's not removing or adding the animation tags to the unit. The animation i want is called Attack. I want to remove Attack One Alternate and Attack Two Alternate. So i've put add animation tag Attack and remove animation tag for the other 2 but it's still not working, is there some sort of animation ID i have to enter?
 
well, if you're making a trigger where you want the unit to play an animation, just do what i said above.

if you're trying to make a unit that will only use one animation whenever it attacks, sorry cant help. :(

That last thing ain't too hard, here is a small example, perhaps not the most efficient of code, but hench it should work

  • Attack Animation Blademaster
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Blademaster
    • Actions
      • Set attackingUnit = (Attacking unit)
      • Custom script: call SetUnitAnimationByIndex (udg_attackingUnit, 2)
      • Animation - Queue attackingUnit's stand animation
The event enables the trigger when a unit is attacked (there is no real function for "if a unit is attacking") so were basically doing it the other way around.

because you only want a specific type of unit(s) to do this, you narrow the enablement down with a conditional statement, in this case "Unit - Type Comparison", we use the attacking unit, cause we don't want to know whom the attacked unit is, but the attacker; in this case the Blademaster unit type.

Next up the actions, first of all I saved the attacking unit, in a unit variable (this allows easier acces in your custom script next up).
Following up, we make A script call "SetUnitAnimationByIndex", between the () we first fill in the first parameter which is the unit we are refering to, so in this case attackingUnit, cause of the global scope the variable has, we have to put udg_ in front of it.
We close that with a ","to then fill out the next parameter, this is the Index number of the units animation (in this case2)
Note: you can find animation index numbers easily with wc3viewer.

Conclusively we Que the stand animation, so the unit doesn't freeze after it has attacked.

And there you have it, hope this helps you out ;)
 
Status
Not open for further replies.
Back
Top