The game looks up which animation has the activity set for it. Check the QC file for which animations have which activities.

As far as movement goes, each animation defines how far it moves. The root bone is used to determine where the animation starts and ends, end - start (position in last frame - position in first frame) determines how far movement goes, the rotation defined for the animation affects which direction movement will go in.

Movement speed is determined by movement distance * (framerate / number of frames - 1). The fewer frames and the higher the framerate, the faster movement will be.If there are no frames then movement speed is always 0.

None of the models in the SDK specify rotation, so don't be surprised if it doesn't work properly.

pflGroundSpeed is movement speed, pflFrameRate is the framerate for the animation, which is independent of the entity framerate. The final framerate is pflFrameRate * entity framerate, so movement speed will be affected by that as well.

Some entities may override this so check their MoveExecute method. If you wanted to, you could add a keyvalue that overrides the animation movement speed, or that multiplies it to speed up/slow down the entity.

When i check tree.mdl there is 2 animations. idle1 and attackSecond animation is attack and indexed 1 (the other one is indexed 0)But how game knows attack in model file is actually ACT_MELEE_ATTACK1 from activity.h

Yes, it will have to be done via animation creation. A quick breakdown:

Here is an imported scientist model walk and what it looks like in blender:

Im using an example from the gordon scientist model in bshift who's walking sequence moves Bip01 forward about 48 units (-48Y as it says in the blender inspector) which means he will move 48 hammer units per animation cycle (how ever many frames at how ever fps, this gif does not represent final fps).

Now basically in order to make an NPC "move" you make a walking animation and have the root bone (Often called "Bip01" as per standard HL skeletons) keyframed to move forward a set distance (depending how fast your custom NPC is moving) and with linear keyframes for just that root bone. See my above example of that scientist walk

The way I test to see if extraction is working is open the compiled model in HLMV and go to the "walk" animation. If it is walking in place then the extraction worked.

A while back I made 2 methods of "fixing" walk animations that drag but this exact method can be used to change existing NPC movement speeds, so use a higher number for more distance per loop cycle and a lower number for slower distance per loop cycleBlender method3dsmax method