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

[General] Casting Animation With Attack

Status
Not open for further replies.
Level 9
Joined
Apr 30, 2010
Messages
324
Well, i want the unit play an animation when it cast.. the animation is Attack - 3.. But whenever i write attack,3 or attack - 3 on the object editor, it won't run the animation... attack,3 ,will play a random attack animation, and attack - 3 won't play any animation... since, attack, slam .. spell, slam.. spell, throw ,already been used for other purpose.. i need to know how to play specific attack animation..
 
Level 11
Joined
Nov 15, 2007
Messages
781
You need to use (via custom script) SetUnitAnimationByIndex(unit, index)

Indexes start at 0 and there's really no way of knowing which corresponds to what animation other than testing them yourself.
 
Level 9
Joined
Apr 30, 2010
Messages
324
You need to use (via custom script) SetUnitAnimationByIndex(unit, index)

Indexes start at 0 and there's really no way of knowing which corresponds to what animation other than testing them yourself.

If you open that model in WC3 viewer, the animation list in there is sorted by animation index. Don't forget indexes start at 0 and *No animation* does not count among them.

I'm not really good at jass/custom script, how do i wrote them? Can post the trigger?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
The custom script is exactly how Meticulous wrote it:
  • Custom script: SetUnitAnimationByIndex(unit, index)
  • e.g.
  • Custom script: SetUnitAnimationByIndex(udg_unitVariable, 1)
1 is just random index.

WC3 Viewer is a program for opening WC3 mpqs and browsing them.
 
Level 9
Joined
Apr 30, 2010
Messages
324
i got an error :/

tell me what is the problem

  • Raging Blow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raging Blow
    • Actions
      • Set RB = (Triggering unit)
      • Custom script: SetUnitAnimationByIndex(udg_RB, 2)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (((0.20 x (Real((Level of Raging Blow for (Triggering unit))))) + 1.50) x (Real((Agility of (Triggering unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
      • Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using war3mapImported\Effect_Hit_B.mdx
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
      • Special Effect - Destroy (Last created special effect)
 

Attachments

  • Untitled.png
    Untitled.png
    65.2 KB · Views: 124
Status
Not open for further replies.
Top