Get a table of available animations?

I want to get a table of all possible animations and their names for a certain entity. Is there any way how to actually do it?

Example: i want to print all available animations for my current weapons v_model.

I’m not sure if you can. But you can get them in the model viewer and use SysExp to grab all the animations from the animation tree.

You can get a list of valid ACT_ enumerations using

[lua]local tab = { }
for i = 0, 1000 do
if( ent:SelectWeightedSequence( i ) > -1 ) then
table.insert( tab, i );

This should be fairly simple to do through a module. Look at a model with animations inside a hex editor.

IDST<engine version>000****<model path><variable length model data, maybe designated by the value inside ****?>

Towards the end of the model data, there is the physics material, a list of bones and attachments, and then the really interesting information:

@sequence_name seems to refer to the smd file that contains the animation in question, and then further down, we have a setup like this:

<sequence name>\0<ACT_ enum>. This gives us the ACT_* enum that can be used to invoke the sequence, as well as the name of the sequence.

Past that is the material and location of the material, then end of file.

So getting this information, in theory, is as simple as parsing this file, not regarding that there’s probably a built-in method to do this in studiomdl.dll.

Never even tried to make a module, i suck at c++ :frowning: