Custom Player Animations

How are player animations stored and how would I go about to using them in my gamemode/addons (how would I assign them an ACT_ enum)?

All animations are done there:

You can’t add your own animations.

Are you sure? I’m pretty sure I’ve seen gamemodes use custom player animations. I think GMT has some like ‘lay’ or something

There are a ton of build in ones that are unused. You can only modify bones through Lua to achieve “animations” but it’s not the same thing.

Ah, well how would I go about to doing that? I’ve seen pre gmod 13 gamemodes modify bones to do animations if I recall.
How does extreme football throwdown do different animations.

Either using Lua Animation API ( GOOGLE IT ) or Entity:BoneManipulate* functions ( GOOGLE THEM )

EFT uses all stock animations. I might have manually changed the cycle on them to make it look like they were different than normal.

I had no idea what they were named. That’s why I’m here. And thanks

[editline]3rd February 2014[/editline]

How exactly do you do this? I apologize since I have no experience in working with animations.

I thought I’d bump this because I’ve managed to achieve a hacky way of doing this.
Basically I decompiled one of the citizen player models, and added an animation.

When recompiling it I set up the QC to use an act enumeration I am pretty sure didn’t do anything at least on the citizen player model, I may be wrong though if I am please correct me.

For example…

$sequence "wave" "male_02_anims\anim_wave.smd" {
	fps 30

Then I recompiled it and was successfully able to trigger the animation by using the enumeration specified in the QC with this function.

The main downside I see to this though is that I believe you’d have to recompile every model that you would want to have the custom animation. Which would be a pain for other users to download.
Although it’s a good learning experience with making animations.

This is a bad idea. What if there are more than one mod that overrides playermodel animations?

Wouldn’t it not be a problem though if the animation was not actually used by the player model? For example when I tried to play that enumeration originally ( ACT_HANDGRENADE_THROW3 ) on the player model it did not do anything, so I just assumed it was unused by that model. Sorry if I’m completely wrong or if I’m misunderstanding you, still getting a hang of the whole modeling and animating scene.

I mean, if modders start recompiling all the playermodels ( or the animation models ) and start bundling those recompiled models with their mods, the models will override each other and the chances are your custom animations won’t work because other mods with custom animations are overriding the files.

If you change the path and the file name for the player model would it be possible to avoid such an issue?

By that I mean, if you change it within the QC and then compiled it, like…

$modelname "player/custom_models/group01/pancakes/male_02_ext.mdl"

Resulting in double playermodels and forcing players to change player model to one of yours for the animations to work? I don’t think this is a solution.

Yeah that’s understandable, I was only planning to do it with the citizen models anyways since I wanted to add multiple skins of clothing as well. Thanks for clearing that up though. Do you have any idea if there will be an actual convenient method of adding animations to player models in the future?

I’ll check out the lua animation API though, would be a lot more of a clean way to make animations without doubling the player model count like you said.

I don’t know exactly how the source model include stuff works, so I can’t give you a definitive answer. If there’s a way to force a model to be included into another model in code ( alternative to $includemodel .qc command ), then it may be possible, for now your best bet is Lua Animation API, if you can figure out how to use it.

Hmm checking it out now and it looks pretty straight forward, kinda reminds me of the SWEP Construction Kit in a way. Pity it took me so long to finally look into it. Thanks again for the advice.


Wow what a nice tool, it sure beats what I was doing before.