Contents

Entity description

Grabs an NPC and makes them play a specified set of animations. The NPC can be told to move to the scripted sequence position or can be told to play the script wherever they currently are. Multiple scripted sequences of the same name will frame-synchronize in the action animation once all the actors have moved to position. This allows tight interaction between actors (one actor grabbing another, hitting them, etc.) The flow is as follows:

Move to position using the specified movement animation. If "Move to Position" is set to "None", skip to step 2.

If forced to wait for another actor to move to position, play the pre-action idle animation, otherwise skip to step 3. If there is no pre-action idle specified, "ACT_IDLE" is used.

Fire the "OnBeginSequence" output.

Play the action animation. If no action animation is specified, skip to step 5.

Play the post-action idle animation. If none is specified, skip to step 6. If the "Loop in Post Idle" spawnflag is set, keep playing the post-action idle until the script is canceled. If no post-action idle animation is specified, "ACT_IDLE" is used.

Fire the "OnEndSequence" output.

If a next script to play is specified, hand the NPC to the next script and repeat this process for that script.

The "MoveToPosition" input runs steps 1 and 2, then waits while playing the pre-action idle animation until the "BeginSequence" input is received.

Keyvalues

Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.

Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.

Note:Try to avoid expensive operations in this function, as it may cause performance problems.

The name of the sequence (such as "idle01") or activity (such as 'ACT_IDLE') to play before the action animation if the NPC must wait for the script to be triggered. Use "Start on Spawn" flag or "MoveToPosition" input to play this idle animation.

Used in conjunction with the 'Custom movement' setting for the 'Move to Position' property, specifies the sequence (such as 'crouch_run01') or activity (such as 'ACT_RUN') to use while moving to the scripted position.

Useful for when NPCs playing scripts must interpenetrate while riding on trains, elevators, etc. This only disables collisions between the NPCs in the script and must be enabled on BOTH scripted_sequences.

Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.Format: <key> <value>Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>

Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.

Bug:In , the code is executed in the script scope of the entity that fires the output, not the one receiving the input.

Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.

Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.

As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.

ClearParent

Removes this entity from the the movement hierarchy, leaving it free to move independently.

BeginSequence

Summons an NPC to act out the scripted sequence.

MoveToPosition

Summons an NPC to the script location. They will play their scripted idle (or "ACT_IDLE" if none is specified) until "BeginSequence" is triggered.

CancelSequence

Stops the scripted sequence. If fired after a sequence starts, this input will not take effect until the NPC finishes playing the scripted action animation.

Outputs

Targetname:

OnUser1toOnUser4

These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.

OnKilled(Only in the Left 4 Dead series)

This Output fires when the entity is killed and removed from the game.

OnBeginSequence

Fires when the action animation begins playing.

OnEndSequence

Fires when the action animation completes.

OnScriptEvent(01-08)

Fires when a 'trigger' anim event occurs while playing the script. Use { event 1003 framenum (1-8) } in the QC.

Locating animations

You can use the model tab in the entity window.

Or

You can use the Half-life Model Viewer tool to see all the available sequences(Animations) for the model you're using.
You can find the application in the Source SDK.

When you've launched the tool go to File and load the model you want. Then go to the Sequence tab and select an animation from the dropdown menu to get the model you've select to play that animation or sequence.