Jump to content

How to check if an animation exists for current build with code?


Recommended Posts

If you do inst.AnimState:PlayAnimation or PushAnimation with an animation that does not exist, the inst will simply get invisible.

How to check in advance if an animation exist?
Is there something like inst.AnimState:HasAnimation ? (this particular one does not exist, I already searched for it :D)

Link to comment
Share on other sites

  • Developer
AddOverrideBuild
AnimDone
AssignItemSkins
BuildHasSymbol
ClearAllOverrideSymbols
ClearBloomEffectHandle
ClearOverrideBuild
ClearOverrideSymbol
ClearSymbolExchanges
CompareSymbolBuilds
FastForward
GetAddColour
GetBuild
GetCurrentAnimationLength
GetCurrentAnimationTime
GetCurrentFacing
GetInheritsSortKey
GetMultColour
GetSkinBuild
GetSortOrder
GetSymbolPosition
Hide
HideSymbol
IsCurrentAnimation
OverrideItemSkinSymbol
OverrideMultColour
OverrideShade
OverrideSkinSymbol
OverrideSymbol
Pause
PlayAnimation
PushAnimation
Resume
SetAddColour
SetBank
SetBankAndPlayAnimation
SetBloomEffectHandle
SetBuild
SetClientSideBuildOverrideFlag
SetClientsideBuildOverride
SetDeltaTimeMultiplier
SetErosionParams
SetFinalOffset
SetFloatParams
SetHaunted
SetHighlightColour
SetInheritsSortKey
SetLayer
SetLightOverride
SetManualBB
SetMultColour
SetMultiSymbolExchange
SetOceanBlendParams
SetOrientation
SetPercent
SetRayTestOnBB
SetScale
SetSkin
SetSortOrder
SetSortWorldOffset
SetSymbolExchange
SetTime
Show
ShowSymbol

This is the full list of AnimState functions, if you can't accomplish it by these, you can't do it.
you might, might be able to check if an anim exists, if it uses a custom symbol inside that animation only with BuildHasSymbol
but otherwise it doesn't look good.

  • Like 1
Link to comment
Share on other sites

5 hours ago, Zarklord said:

This is the full list of AnimState functions, if you can't accomplish it by these, you can't do it.
you might, might be able to check if an anim exists, if it uses a custom symbol inside that animation only with BuildHasSymbol
but otherwise it doesn't look good.

thank you.
I ask because of woodies wereforms and maybe mod characters. The teleportato and the adventure mod are putting character to the state teleportato_teleport or throne_sit. These states exists on wereform, so this check wont help. But when the animations from these states are called, they get invisble and some even reported a crash for the moose, but I was not able to reproduce it.

I noticed when trying emotes in wereform, only the dance animation will play. The others wont play, since I guess there is no animation for it. So here already might be a check for this? Or are emotes handled differently?

Of course I can write exceptiions for the wereforms, but a general solution would be better.

Edited by Serpens
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...