• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

BlzFrameSetSpriteAnimate crib

Lua:
---@param frame framehandle
---@param primaryProp integer
---@param flags integer
---@return nothing

function BlzFrameSetSpriteAnimate(frame, primaryProp, flags) end    -- (native)

Controls a sprite’s animation queue, but not in the most intuitive way.

frame​

Only works on two frame types: SPRITE and STATUSBAR.

primaryProp​

You pass in a number, but it’s not an animation ID from the model.
Instead, it maps to a token from this list (total 26 tokens). Not sure how widely known this is, @Tasyen's The Big UI-Frame Tutorial only mentions the first 5 tokens.

primaryPropAnimation name substring
0Birth
1Death
2Stand
3Morph
4Alternate
5Found
6MainMenu
7SinglePlayer
8SinglePlayerSkirmish
9Campaign
10MultiPlayer
11MultiPlayerPreGameChat
12ViewReplay
13BattleNetChatRoom
14BattleNetCustom
15BattleNetCustomCreate
16BattleNetWelcome
17BattleNetAMM
18BattleNetAdvancedOptions
19BattleNetChannel
20BattleNetProfile
21BattleNetTeamChat
22BattleNetUserList
23Options
24RealmSelection
25MainCancelPanel

Lua:
local primaryPropsDict = {
        [0] = "birth",
        [1] = "death",
        [2] = "stand",
        [3] = "morph",
        [4] = "alternate",
        [5] = "found",
        [6] = "mainmenu",
        [7] = "singleplayer",
        [8] = "singleplayerskirmish",
        [9] = "campaign",
        [10] = "multiplayer",
        [11] = "multiplayerpregamechat",
        [12] = "viewreplay",
        [13] = "battlenetchatroom",
        [14] = "battlenetcustom",
        [15] = "battlenetcustomcreate",
        [16] = "battlenetwelcome",
        [17] = "battlenetamm",
        [18] = "battlenetadvancedoptions",
        [19] = "battlenetchannel",
        [20] = "battlenetprofile",
        [21] = "battlenetteamchat",
        [22] = "battlenetuserlist",
        [23] = "options",
        [24] = "realmselection",
        [25] = "maincancelpanel",
    }

Lua:
ANIM_SPRITE_PROP_BIRTH = 0
ANIM_SPRITE_PROP_DEATH = 1
ANIM_SPRITE_PROP_STAND = 2
ANIM_SPRITE_PROP_MORPH = 3
ANIM_SPRITE_PROP_ALTERNATE = 4
ANIM_SPRITE_PROP_FOUND = 5
ANIM_SPRITE_PROP_MAINMENU = 6
ANIM_SPRITE_PROP_SINGLEPLAYER = 7
ANIM_SPRITE_PROP_SINGLEPLAYERSKIRMISH = 8
ANIM_SPRITE_PROP_CAMPAIGN = 9
ANIM_SPRITE_PROP_MULTIPLAYER = 10
ANIM_SPRITE_PROP_MULTIPLAYERPREGAMECHAT = 11
ANIM_SPRITE_PROP_VIEWREPLAY = 12
ANIM_SPRITE_PROP_BATTLENETCHATROOM = 13
ANIM_SPRITE_PROP_BATTLENETCUSTOM = 14
ANIM_SPRITE_PROP_BATTLENETCUSTOMCREATE = 15
ANIM_SPRITE_PROP_BATTLENETWELCOME = 16
ANIM_SPRITE_PROP_BATTLENETAMM = 17
ANIM_SPRITE_PROP_BATTLENETADVANCEDOPTIONS = 18
ANIM_SPRITE_PROP_BATTLENETCHANNEL = 19
ANIM_SPRITE_PROP_BATTLENETPROFILE = 20
ANIM_SPRITE_PROP_BATTLENETTEAMCHAT = 21
ANIM_SPRITE_PROP_BATTLENETUSERLIST = 22
ANIM_SPRITE_PROP_OPTIONS = 23
ANIM_SPRITE_PROP_REALMSELECTION = 24
ANIM_SPRITE_PROP_MAINCANCELPANEL = 25

flags​

This is a bitmask. You can combine flags using addition
(e.g. use queue + pick first matching = 2 + 8 = 10).

Not fully explored — let me know if you’ve got more info.

Flag ValueDescription
0Clears the queue and immediately sets the new animation
1Adds to queue only if following a NonLooping animation
2Adds animation to the end of the queue
3Seems like same as 2; if none of 1–3 is set, queue gets wiped
4Unknown (seems to do nothing)
8Selects the first matching animation from the model (the one with the lowest internal ID).
By default, if multiple animations share the same token (e.g. Stand - 1, Stand - 2, etc.), one of them is picked at random.
16Selects the least rare animation (lowest Rarity)
32Selects the rarest animation (highest Rarity)
48Same as 16
4096Unknown
12224Unknown
16384Unknown

Usage examples​

Lua:
local spr

-- Set a Stand animation
BlzFrameSetSpriteAnimate(spr, 2, 0)

-- Set the rarest version of Stand
BlzFrameSetSpriteAnimate(spr, 2, 32)

-- Queue up all 26 animations
-- Note: The queue runs even while the game is paused
for i = 0, 25 do
    BlzFrameSetSpriteAnimate(spr, i, 2)
end

-- Queue only the rarest versions
for i = 0, 25 do
    BlzFrameSetSpriteAnimate(spr, i, 34) -- 2 + 32
end
Last edited:
Top