Difference between activity, sequence, gesture, scene?

I’m trying to teach myself how to animate entities using LUA and I’m not doing very well.

Each of these seem to be tied to animations in some way, but whenever I think I’ve got it, I end up being wrong.

What’s the difference between them?

  • Sequence (e.g. ent:SetSequence() )
  • Activity (e.g. nextbot:StartActivity() )
  • Gesture (e.g. ent:RestartGesture() )
  • Scene (e.g. ent:PlayScene() )

Sequence is what you should be using for most animations.

It plays a simple animation that you can compile with the model using a modelling tool like Blender.
It only plays a single sequence at a time (unless you use something like

Entity:SetLayerWeight).
This might make more sense if you read this:

Gesture is for a sequence you only want to play on part of the model.

For example, if a player is walking and you want them to wave, you wouldn’t want their feet to stop and for them to suddenly slide across the ground playing a wave animation. You’d want their legs to continue playing the walking animation while their hands play the waving animation. This wave would be a gesture, and in fact it is, ACT_GMOD_GESTURE_WAVE.

Activity seems to be just for NextBots. Unless you’re making a NextBot, you probably don’t need to worry about it.

Scene is for things like the opening scene of Half Life 2.

I think they can include facial animation and sound playing, but unless you want an actual scene to take place, you probably don’t want to use this either.

[editline]13th September 2017[/editline]

I’m not much of a modeller or animator, but I have compiled an animation and played it in Garry’s Mod using

Entity:ResetSequence before, so I can confirm that sequences work pretty well

Well summed up, thanks heaps for that MPan1!

I don’t think you should trust me on this. I’m not 100% sure of the difference between a sequence and a gesture, given that things like

Entity:AddGestureSequence exist.

Sequences are base animations. They are what modelers create in 3ds max/blender.

Activities are just sequences, their thing is that one activity can contain multiple sequences, but one sequence can only correspond to one activity. This way for example you can have ACT_VM_PRIMARYATTACK play 2 different animations on random with no code required to to decide which sequence to play, not need to make lists of sequences per model, etc.

Sequences are usually named randomly by model developers, activities are standardized, meaning for a view model, you can be almost certain ACT_VM_PRIMARYATTACK will be the shooting animation, etc.

Gestures and postures are just special sequences meant to be blended with other sequences (like hold types for players, and the walking animations), they are not defined in the model in any special way unlike activities, but they usually contain the “gesture”, “gst”, “posture” or similar things in their names.

A scene is just a series of sequence names & facial expressions as well as sound paths (super simplified) stored in a .vcd file using an external tool, such as the bin/faceposer.exe or whatever its called. They are primarily used by Valve in HL2 to, well, play story scenes in maps and things like that.