Animations

How would one force a players model to play an animation, such as the animation when a metocop is on fire?

**[Entity.SetAnimation

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Entity.SetAnimation)**

For example,


pl:SetAnimation( PLAYER_ATTACK1 )

However, not all animations work with players I don’t think. I don’t think players have a built-in on fire animation.

any way to make it so they do?
[edit]



function doanimation(pl)
pl:SetAnimation( CROUCH )
end
concommand.Add("do_animation", doanimation)


This did nothing. Do need something more?

Custom player models, or by “hacking” it.

Create an entity ( prop_dynamic or a clientside model, both work I think ), and set the sequence you want the player to run on that. Give the player a build bone positions function that puts their bones where the entity that’s playing the animation has them.

End result would be the player looks like they are using the animation.

It’s how this works, in a way, except the model is pasted over an npc rather than any model.

[hd]http://www.youtube.com/watch?v=AGSVubbENJM[/hd]

Drawbacks include that you need to alias the bones if they don’t share the same skeleton, like if you wanted to do this with headcrabs or crows or something, and that it doesn’t always look the best.

I understood about 30% of that.
Any example scripts laying around?
[edit]
Say i wanted to use “Cheer1” animation, that i found in the model viewer.
I don’t see that on the Entity.SetAnimation list.
What would the function for doing that one be?

You can blame Unreal Omega for that :wink:, I never quite liked that layout change. This page doesn’t show the prefix of the enumeration. Here’s a list with names you can copy and paste directly : http://wiki.garrysmod.com/index.php?title=Enumeration_List:Act&oldid=23306



function doanimation(pl)
pl:SetAnimation( ACT_WALK_ON_FIRE )
end
concommand.Add("do_animation", doanimation)


Still not doing anything.
Any more idea’s?