• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Unit animation doesn't play on spellcast from trigger

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2012
Messages
22
I wasn't too sure if this was a object editor or trigger problem but I think it's an object editor related issue so I'll post here.

I'm trying to play a unit animation from trigger on spellcast but no matter what I do, it only plays the animation that's set in Art - Animation Names. The spell is based on channel. Is there like some sort of override option in object editor that forces only animations from trigger to play? Here's the relevant snippet of the code:

JASS:
library SPELLTEST initializer OnInit requires SpellEvent, TimerUtils, GroupFilter, Damage
    globals
        private constant integer ABILITY_ID = 'A00C'
    endglobals
    
    private function OnCast takes nothing returns nothing
        local unit caster = GetTriggerUnit()
        call SetUnitAnimation(caster, "Spell Three") //Does not play no matter what
        set caster = null
    endfunction
    private function OnInit takes nothing returns nothing
        call RegisterSpellCastEvent(ABILITY_ID, function OnCast)
    endfunction
endlibrary
 
Level 3
Joined
Aug 4, 2012
Messages
22
Well, As far as I know, Channel only plays animation from the object editor. The animation can't be triggered.

What the.. really!?!? Time to copy another ability then :( What are some abilities (unit/point target based) i can use for this?
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
Isn't there a way to play a custom animation with channel if you set the units follow through time and cast back swing to 0.00? Then you just detect when the ability is used and play the animation you want.

There may be more to it. I don't remember all the details. Check the tutorial section for help.
 
Status
Not open for further replies.
Top