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

[Solved] Animation while casting spell?

Status
Not open for further replies.
Level 7
Joined
Jul 3, 2011
Messages
251
Hey guys, i need help, im making a spell but im not entirely sure how to make a unit play animation WHILE its casting a spell (Not a channel spell) the spell is fan of knives with a 2 second cast time, ive tried using begins casting an ability, yet still nothing. So in short; how do you give units casting spells with wait animation? +rep and my gratitude for anyone that helps!
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Channel mean not channeling yes? or channel based? :S

If you want to force your ability to play animation fill proper tags in field Art - Animation tags. Just select your ability in Ability Editor and find this field in 'Art' section.
With triggers there are few ways:
You can either use:
  • init
    • Events
      • Unit - Starts the effect of ability
    • Conditions
      • <stuff here>
    • Actions
      • Unit - Play (Triggering unit)'s ANIMATIONTAG animation
Where ANIMATIONTAG is string of given animation like: 'move' or 'attack'.

You can also use:
  • Custom script: call SetUnitAnimationByIndex(udg_yourunit, ANIMATIONNUMBER)
Where yourunit is unit variable and ANIMATIONNUMBER is integer via which target animation is played - each animation has it's own number but its differend for every unit.

You can check animation numbers for your unit with simple trigger:
  • init
    • Events
      • Time - Every 2 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex(udg_yourunit, udg_i)
      • Game - Display to (All players) message: String(i)
      • Set i =( i +1)
Where 'i' is simple integer variable set by default to 0 and with it's help you will check number for each animation - and for sure you will get the number you need.
 
Status
Not open for further replies.
Top