MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / StartAnimation

Method StartAnimation

Code/CryEngine/CryEntitySystem/ScriptBind_Entity.cpp:2770–2891  ·  view source on GitHub ↗

! Starts an animation of a character @param pos Number of the character slot @param animname Name of the animation from the .chrparams file @see CScriptBind_Entity::LoadCharacter @see CEntity::StartAnimation */

Source from the content-addressed store, hash-verified

2768 @see CEntity::StartAnimation
2769 */
2770int CScriptBind_Entity::StartAnimation(IFunctionHandler* pH)
2771{
2772 GET_ENTITY;
2773
2774 //SCRIPT_CHECK_PARAMETERS(2);
2775 const char* animname;
2776 int pos, layer = 0;
2777
2778 bool bLooping = false;
2779 bool bRecursive(false);
2780 bool partial(false);
2781 bool bForceSingleFrame(false);
2782
2783 float fBlendTime = 0.15f;
2784 float fAniSpeed = 1.0f;
2785
2786 pH->GetParam(1, pos);
2787 if (!pH->GetParam(2, animname))
2788 {
2789 m_pISystem->Warning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, 0,
2790 0, "CScriptBind_Entity::StartAnimation, animation name not specified, in Entity %s", pEntity->GetName());
2791 return pH->EndFunction(false);
2792 }
2793
2794 if (pH->GetParamCount() > 2)
2795 {
2796 pH->GetParam(3, layer);
2797 if (pH->GetParamCount() > 3)
2798 {
2799 pH->GetParam(4, fBlendTime);
2800 if (pH->GetParamCount() > 4)
2801 {
2802 pH->GetParam(5, fAniSpeed);
2803 if (pH->GetParamCount() > 5)
2804 {
2805 pH->GetParam(6, bLooping);
2806
2807 if (pH->GetParamCount() > 6)
2808 {
2809 pH->GetParam(7, bRecursive);
2810
2811 if (pH->GetParamCount() > 7)
2812 {
2813 pH->GetParam(8, partial);
2814
2815 if (pH->GetParamCount() > 8)
2816 pH->GetParam(9, bForceSingleFrame);
2817 }
2818 }
2819 }
2820 }
2821 }
2822 }
2823
2824 ICharacterInstance* pCharacter = pEntity->GetCharacter(pos);
2825 // no character no animation
2826 if (!pCharacter)
2827 return pH->EndFunction(false);

Callers

nothing calls this directly

Calls 15

CryLogFunction · 0.85
GetISkeletonAnimMethod · 0.80
GetAnimIDByNameMethod · 0.80
GetIAnimationSetMethod · 0.80
GetDuration_secMethod · 0.80
SetLayerPlaybackScaleMethod · 0.80
IsAnimLoadedMethod · 0.80
CAF_LoadSynchronouslyMethod · 0.80
GetParamMethod · 0.45

Tested by

no test coverage detected