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

Help with attack animation

Status
Not open for further replies.
Level 4
Joined
May 18, 2011
Messages
67
Animation Tags

None = VillagerMan Attack
Alternate = Onehand Attack
Channel = Twohand Attack
Defend = Defend Attack
Flesh = Spell Attack
Gold = Duel Attack
Lumber = Bow Attack
Work = Crossbow Attack

call AddUnitAnimationProperties(unit,"Alternate",true)

i dont know how to use this function i use custom script but sadly it gives me error...
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Why not try and use?:

  • Custom Script: call SetUnitAnimationByIndex(unit,integer)
You can find out which integer is the correct index by looping through it and then looking at the animation.

EDIT: ow wait, it gave you an error?
Show us the entire trigger then instead of only the custom script part.
I think it is because you don't know how to send parameters to that function using GUI variables.
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
  • Animation - Add the alternate animation tag to (your_unit)
now the unit will play all his alternate animations
for example you have one animation called "attack" and one called "attack gold"

normally he would use the "attack" animation.
if you do this
  • Animation - Add the gold animation tag to (your_unit)
he will do the "attack GOLD" animation

or use this one:
JASS:
call AddUnitAnimationProperties(Your_Unit, alternate, true)
this will do the same, just type your unit and the animation tag you want to add (in this case i chose alternate)
 
Level 4
Joined
May 18, 2011
Messages
67
JASS:
call AddUnitAnimationProperties(Your_Unit, alternate, true)
this will do the same, just type your unit and the animation tag you want to add (in this case i chose alternate)

after seing the jass i figure out how to use that code thanks GIMLI hahaha im so dumb with WE
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
after seing the jass i figure out how to use that code thanks GIMLI hahaha im so dumb with WE

Actually, if you are using a GUI variable for your unit you need to use:

JASS:
call AddUnitAnimationProperties(udg_Your_Unit, "alternate", true)

where Your_Unit is a unit variable in GUI.

Since it takes a unit and a string the string should be in double quotes too. And I'm not sure if the string "alternate" would be the correct string in this case.
 
Status
Not open for further replies.
Top