Question about SetUnitAnimationByIndex()

PrisonLove

Hard Realist
Reaction score
78
Is there a cataloged list of the unit animation indices or do I just have to keep trying numbers until I get the animation I want? If there is a list, where can I find it?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Different units have different indexes, you can display it in game with a short test snippet looking something like this:

JASS:
function IndexTest takes nothing returns nothing
    local integer i = 0
    loop
        exitwhen i > 15
        call SetUnitAnimationByIndex(UnitVariable, i)
        call BJDebugMsg(I2S(i))
        call TriggerSleepAction(2.)
        set i = i + 1
    endloop
endfunction


Just store the unit you wish to test in some variable, be that a preplaced gg_ variable or just something you set when the game starts. Just watch the unit's different animations and use the index of the one you want to use.
 

PrisonLove

Hard Realist
Reaction score
78
Yeah I could have done that, I was just wondering if there was a catalog of these indexes somewhere. I guess the answer is no, but thank you for your help!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I reorganized the forums somewhat but I doubt anyone would notice
  • The Helper The Helper:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1
  • The Helper The Helper:
    and I am back :)
    +1
  • The Helper The Helper:
    Happy Tuesday!
    +1

    The Helper Discord

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top