• 🏆 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] Playing specific animations for Special Effects

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
Is there a way to choose a specific animation to play for special effects? Like play Attack - 1 or Attack - 2. I know you can do this using Animation Index for units.

Edit:
Lua:
BlzPlaySpecialEffect(SpecialEffectName, ConvertAnimType(19))

This works for Special Effects.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
I'm using the Paladin model as the Special Effect. This is basically the full code.
Lua:
local sfx = AddSpecialEffectLoc("units\\human\\HeroPaladin\\HeroPaladin.mdl", Location(x, y))
BlzPlaySpecialEffectWithTimeScale(sfx, ANIM_TYPE_ATTACK, 1.0)
It plays the Attack animation but you can't choose which variation and that's the problem. Also, there's no option for other animations like "Ready". What's the deal with these "ANIM_TYPE_X" anyway? Why didn't they use a string or integer like everything else?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
  • Untitled Trigger 004
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • tempint Equal to 0
        • Then - Actions
          • Special Effect - Create a special effect at (Center of (Playable map area)) using units\human\HeroPaladin\HeroPaladin.mdl
          • Custom script: call BlzPlaySpecialEffect( GetLastCreatedEffectBJ(), ConvertAnimType(udg_tempint) )
        • Else - Actions
          • Custom script: call BlzPlaySpecialEffect( GetLastCreatedEffectBJ(), ConvertAnimType(udg_tempint) )
      • Set tempint = (tempint + 1)
      • Game - Display to (All players) the text: (String(tempint))
      • Camera - Pan camera for Player 1 (Red) to (Center of (Playable map area)) over 0.00 seconds
Look it up with this, looks like you are wanting 19 or 28? double check tho.


From IcemanBo's list from the common.j
JASS:
    constant animtype           ANIM_TYPE_BIRTH                 = ConvertAnimType(0)
    constant animtype           ANIM_TYPE_DEATH                 = ConvertAnimType(1)
    constant animtype           ANIM_TYPE_DECAY                 = ConvertAnimType(2)
    constant animtype           ANIM_TYPE_DISSIPATE             = ConvertAnimType(3)
    constant animtype           ANIM_TYPE_STAND                 = ConvertAnimType(4)
    constant animtype           ANIM_TYPE_WALK                  = ConvertAnimType(5)
    constant animtype           ANIM_TYPE_ATTACK                = ConvertAnimType(6)
    constant animtype           ANIM_TYPE_MORPH                 = ConvertAnimType(7)
    constant animtype           ANIM_TYPE_SLEEP                 = ConvertAnimType(8)
    constant animtype           ANIM_TYPE_SPELL                 = ConvertAnimType(9)
    constant animtype           ANIM_TYPE_PORTRAIT              = ConvertAnimType(10)

    constant subanimtype        SUBANIM_TYPE_ROOTED             = ConvertSubAnimType(11)
    constant subanimtype        SUBANIM_TYPE_ALTERNATE_EX       = ConvertSubAnimType(12)
    constant subanimtype        SUBANIM_TYPE_LOOPING            = ConvertSubAnimType(13)
    constant subanimtype        SUBANIM_TYPE_SLAM               = ConvertSubAnimType(14)
    constant subanimtype        SUBANIM_TYPE_THROW              = ConvertSubAnimType(15)
    constant subanimtype        SUBANIM_TYPE_SPIKED             = ConvertSubAnimType(16)
    constant subanimtype        SUBANIM_TYPE_FAST               = ConvertSubAnimType(17)
    constant subanimtype        SUBANIM_TYPE_SPIN               = ConvertSubAnimType(18)
    constant subanimtype        SUBANIM_TYPE_READY              = ConvertSubAnimType(19)
    constant subanimtype        SUBANIM_TYPE_CHANNEL            = ConvertSubAnimType(20)
    constant subanimtype        SUBANIM_TYPE_DEFEND             = ConvertSubAnimType(21)
    constant subanimtype        SUBANIM_TYPE_VICTORY            = ConvertSubAnimType(22)
    constant subanimtype        SUBANIM_TYPE_TURN               = ConvertSubAnimType(23)
    constant subanimtype        SUBANIM_TYPE_LEFT               = ConvertSubAnimType(24)
    constant subanimtype        SUBANIM_TYPE_RIGHT              = ConvertSubAnimType(25)
    constant subanimtype        SUBANIM_TYPE_FIRE               = ConvertSubAnimType(26)
    constant subanimtype        SUBANIM_TYPE_FLESH              = ConvertSubAnimType(27)
    constant subanimtype        SUBANIM_TYPE_HIT                = ConvertSubAnimType(28)
    constant subanimtype        SUBANIM_TYPE_WOUNDED            = ConvertSubAnimType(29)
    constant subanimtype        SUBANIM_TYPE_LIGHT              = ConvertSubAnimType(30)
    constant subanimtype        SUBANIM_TYPE_MODERATE           = ConvertSubAnimType(31)
    constant subanimtype        SUBANIM_TYPE_SEVERE             = ConvertSubAnimType(32)
    constant subanimtype        SUBANIM_TYPE_CRITICAL           = ConvertSubAnimType(33)
    constant subanimtype        SUBANIM_TYPE_COMPLETE           = ConvertSubAnimType(34)
    constant subanimtype        SUBANIM_TYPE_GOLD               = ConvertSubAnimType(35)
    constant subanimtype        SUBANIM_TYPE_LUMBER             = ConvertSubAnimType(36)
    constant subanimtype        SUBANIM_TYPE_WORK               = ConvertSubAnimType(37)
    constant subanimtype        SUBANIM_TYPE_TALK               = ConvertSubAnimType(38)
    constant subanimtype        SUBANIM_TYPE_FIRST              = ConvertSubAnimType(39)
    constant subanimtype        SUBANIM_TYPE_SECOND             = ConvertSubAnimType(40)
    constant subanimtype        SUBANIM_TYPE_THIRD              = ConvertSubAnimType(41)
    constant subanimtype        SUBANIM_TYPE_FOURTH             = ConvertSubAnimType(42)
    constant subanimtype        SUBANIM_TYPE_FIFTH              = ConvertSubAnimType(43)
    constant subanimtype        SUBANIM_TYPE_ONE                = ConvertSubAnimType(44)
    constant subanimtype        SUBANIM_TYPE_TWO                = ConvertSubAnimType(45)
    constant subanimtype        SUBANIM_TYPE_THREE              = ConvertSubAnimType(46)
    constant subanimtype        SUBANIM_TYPE_FOUR               = ConvertSubAnimType(47)
    constant subanimtype        SUBANIM_TYPE_FIVE               = ConvertSubAnimType(48)
    constant subanimtype        SUBANIM_TYPE_SMALL              = ConvertSubAnimType(49)
    constant subanimtype        SUBANIM_TYPE_MEDIUM             = ConvertSubAnimType(50)
    constant subanimtype        SUBANIM_TYPE_LARGE              = ConvertSubAnimType(51)
    constant subanimtype        SUBANIM_TYPE_UPGRADE            = ConvertSubAnimType(52)
    constant subanimtype        SUBANIM_TYPE_DRAIN              = ConvertSubAnimType(53)
    constant subanimtype        SUBANIM_TYPE_FILL               = ConvertSubAnimType(54)
    constant subanimtype        SUBANIM_TYPE_CHAINLIGHTNING     = ConvertSubAnimType(55)
    constant subanimtype        SUBANIM_TYPE_EATTREE            = ConvertSubAnimType(56)
    constant subanimtype        SUBANIM_TYPE_PUKE               = ConvertSubAnimType(57)
    constant subanimtype        SUBANIM_TYPE_FLAIL              = ConvertSubAnimType(58)
    constant subanimtype        SUBANIM_TYPE_OFF                = ConvertSubAnimType(59)
    constant subanimtype        SUBANIM_TYPE_SWIM               = ConvertSubAnimType(60)
    constant subanimtype        SUBANIM_TYPE_ENTANGLE           = ConvertSubAnimType(61)
    constant subanimtype        SUBANIM_TYPE_BERSERK            = ConvertSubAnimType(62)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
ConvertAnimType... didn't know about that. Thank you very much!

I should really look that stuff up. I keep assuming there's all these limitations and that I'm just screwed but I guess that's not the case. Sorry for the stupid question, I'll make sure to reference these in the future.

BlzPlaySpecialEffect(sfx, ConvertAnimType(19)) did the trick.
 
Last edited:
I'm not sure, I was dealing with the same, did you tried add the subanimation then remove it and add other?
Subanimation seems to be "Ready", "Defend", "Alternate", not "1", "2", "3", so not sure how it'd help me.
I just solved the problem by editing the model and removed all Birth-animations except for the one I wanted, resulting in it working for me...
 
Level 24
Joined
Jun 26, 2020
Messages
1,850
Subanimation seems to be "Ready", "Defend", "Alternate", not "1", "2", "3", so not sure how it'd help me.
I just solved the problem by editing the model and removed all Birth-animations except for the one I wanted, resulting in it working for me...
There exists these:
vJASS:
constant subanimtype        SUBANIM_TYPE_FIRST              = ConvertSubAnimType(39)
constant subanimtype        SUBANIM_TYPE_SECOND             = ConvertSubAnimType(40)
constant subanimtype        SUBANIM_TYPE_THIRD              = ConvertSubAnimType(41)
constant subanimtype        SUBANIM_TYPE_FOURTH             = ConvertSubAnimType(42)
constant subanimtype        SUBANIM_TYPE_FIFTH              = ConvertSubAnimType(43)
constant subanimtype        SUBANIM_TYPE_ONE                = ConvertSubAnimType(44)
constant subanimtype        SUBANIM_TYPE_TWO                = ConvertSubAnimType(45)
constant subanimtype        SUBANIM_TYPE_THREE              = ConvertSubAnimType(46)
constant subanimtype        SUBANIM_TYPE_FOUR               = ConvertSubAnimType(47)
constant subanimtype        SUBANIM_TYPE_FIVE               = ConvertSubAnimType(48)
 
Status
Not open for further replies.
Top