Jump to content

Playing Animations...


RockyX

Recommended Posts

I tried everything I look at how other people do it in their mods but the only ways I found to do it are overcomplicated. I got it working, but then the animations were looping, and you had to push to get out of animation… I need to play an animation for my mod from client Lua, so it's an animation like under q to make it look like the player is shouting and also play other animations such as shivering etc… I tried everything ;-; 
this is my default XML.

 

 
<animNode>
  <m_Name>default</m_Name>
  <m_AnimName>Bob_EmoteSurrender</m_AnimName>
  <m_deferredBoneAxis>Y</m_deferredBoneAxis>
  <m_Looped>false</m_Looped>
  <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
  <m_EarlyTransitionOut>true</m_EarlyTransitionOut>
  <m_SpeedScale>0.80</m_SpeedScale>
  <m_BlendTime>0.50</m_BlendTime>
  <m_Conditions>
    <m_Name>emote</m_Name>
    <m_Type>STRING</m_Type>
    <m_StringValue>default</m_StringValue>
  </m_Conditions>
  <m_Events>
    <m_EventName>EmoteFinishing</m_EventName>
    <m_Time>End</m_Time>
    <m_ParameterValue/>
  </m_Events>
  <m_SubStateBoneWeights>
    <boneName>Bip01_Spine</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_Spine1</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_Neck</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_Head</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_L_Clavicle</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_L_UpperArm</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_L_Forearm</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_L_Hand</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_R_Clavicle</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_R_UpperArm</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_R_Forearm</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
  <m_SubStateBoneWeights>
    <boneName>Bip01_R_Hand</boneName>
    <includeDescendants>false</includeDescendants>
  </m_SubStateBoneWeights>
</animNode>

 

 

And example of an animation:

 

 
<animNode x_extends="default.xml">
  <m_Name>EmoteShrug</m_Name>
  <m_AnimName>Bob_EmoteShrug</m_AnimName>
  <m_Conditions>
    <m_Name>emote</m_Name>
    <m_Type>STRING</m_Type>
    <m_StringValue>emote_shrug</m_StringValue>
  </m_Conditions>
</animNode>

 


How I tried animate in client Lua, but it doesn't work…
 

 
function playUnloopedAnim(player, animName)
    local looped = false -- Set looped to false to play the animation once

    -- Play the animation
    player:PlayAnim(animName, looped)

    -- Wait for the animation to finish
    while player:isPlayingAnim(animName) do
        -- Do nothing, just wait
    end

    -- Stop the animation
    player:StopAnim(animName)
end
 

 

Can someone show me how to use this animation in Lua client please?

\media\AnimSets\player\actions this is where the XML is located

here are the animations \media\anims_X\bob

and the example anim Bob_EmoteShrug.X

I want other players to see the animations, so I'm assuming that I will have to play the animation from the server, which is alright as I already have an event for this function to send a global message from a player, but I don't have a clue on what else to try to animation to work…

I don't want it to be a timed action, but that's the only way I made it seem to work… Any help would greatly appreciate.

 

Edited by RockyX
Link to comment
Share on other sites

  • 9 months later...

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
×
×
  • Create New...