scripted_sequence
- Half-Life: Alyx
- Steam VR
Point Entity
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 (or sync group, if specified) 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 cancelled. 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.
If the sequence has motion extraction in it, set the 'Don't Teleport NPC On End' spawnflag.
Keyvalues
-
Target NPC (
m_iszEntity
) <TargetDestination
>
The name or class name (such as 'npc_zombie') of an NPC to use for this script. -
Pre Action Idle Animation (
m_iszIdle
) <Sequence
>
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. -
Entry Animation (
m_iszEntry
) <Sequence
>
The name of the sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play when the sequence starts, before transitioning to play the main action sequence. -
Action Animation (
m_iszPlay
) <Sequence
>
The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play. -
Post Action Idle Animation (
m_iszPostIdle
) <Sequence
>
The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation. -
Custom Move Animation (
m_iszCustomMove
) <Sequence
>
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. -
Synchronization Group (
sync_group
) <String
>
If set, identifier used to match other scripted sequences to synchronze with (alternative to name-based sync) -
Loop Action Animation? (
m_bLoopActionSequence
) <Boolean
> -
Synch Post Idles? (
m_bSynchPostIdles
) <Boolean
> -
Allow custom interrupt conditions to be set. (
m_bAllowCustomInterruptConditions
) <Boolean
> -
Script Conflict Response (
conflict_response
) <Choices
>
What to do if this scripted sequence begins and the actor is already executing a scripted sequence.- Enqueue
- Interrupt
-
Ground IK Preference (
m_nGroundIKPreference
) <Choices
>
If this NPC has ground IK; whether we disable it for the playthrough of the sequence or not.- No change
- Disable for this sequence
-
Search Radius (0=everywhere) (
m_flRadius
) <Integer
>
Radius to search within for an NPC to use. 0 searches everywhere. -
Repeat Rate ms (
m_flRepeat
) <Integer
> -
Move to Position (
m_fMoveTo
) <Choices
>- No
- Walk
- Run
- Custom movement
- Instantaneous
- No - Turn to Face
-
Next Script (
m_iszNextScript
) <TargetDestination
>
The name of the script to run immediately after this script completes. The NPC will not return to AI between the two scripts. -
Ignore Gravity on NPC during script (
m_bIgnoreGravity
) <Boolean
>
If this is set to 'Yes', the NPC will not be subject to gravity while playing this script. -
Disable NPC collisions during script (
m_bDisableNPCCollisions
) <Boolean
>
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. -
Keep Animgraph Locked after script (
m_bKeepAnimgraphLockedPost
) <Boolean
>
If set, the animgraph will remain locked in the Direct Playback node after this sequence finishes. This is only useful if you have a 'Next Script' set, and you don't want the animgraph to return to Idle during the transition. Note that the 'Next Script' cannot require the NPC to animate/move to it, because the NPC will be unable to move while in the Direct Playback node. In that case, or if you have no 'Next Script' set, selecting this will simply cause the NPC to freeze after it finishes the sequence. -
Spawnflags (
spawnflags
) <Flags
>- Repeatable
- Leave Corpse (if not, fade)
- Start on Spawn
- No Interruptions
- Override AI
- Don't Teleport NPC On End
- Loop in Post Idle
- Priority Script
- Hide Debug Complaints
- Allow other NPC actors to continue after this NPC actor's death
-
On player death (
onplayerdeath
) <Choices
>
What this entity should do if the player dies.- Do Nothing
- Cancel Script and return to AI
-
On NPC actor death (
onnpcdeath
) <Choices
>
What the NPC performing this script should do if it dies.- LEGACY - Use old settings
- Ragdoll immediately
- Perform a death animation
-
Prevent Yaw Update on Finish (
prevent_update_yaw_on_finish
) <Choices
>
By default, when finishing the sequence, the NPC has its ideal yaw updated to maintain the current forward facing. This allows you to prevent that if you want to return to the facing prior to starting the sequence.- No
- Yes
-
Ensure on Nav Mesh on Finish (
ensure_on_navmesh_on_finish
) <Choices
>
When finishing the sequence, if the NPC uses the navmesh, ensure the NPC is on a valid location on the navmesh.- No
- Yes
Inputs
-
BeginSequence <
Void
>
Summons an NPC to act out the scripted sequence. -
MoveToPosition <
Void
>
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 <
Void
>
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. -
SetActionSequence <
String
>
Sets the name of the action sequence that will play when the action sequence plays. Can be used for branching sequences.
Outputs
-
OnBeginSequence <
Void
>
Fires when the scripted sequence begins playing. -
OnActionStartOrLoop <
Void
>
Fires when the action animation begins playing and each time it loops. -
OnEndSequence <
Void
>
Fires when the action animation completes. -
OnCancelSequence <
Void
>
Fires when the sequence is cancelled. -
OnCancelFailedSequence <
Void
>
Fires when the sequence is cancelled without ever playing (OnCancelSequence will also fire). -
OnScriptEvent01 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent02 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent03 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent04 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent05 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent06 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent07 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent08 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script.
Point Entity
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 (or sync group, if specified) 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 cancelled. 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.
If the sequence has motion extraction in it, set the 'Don't Teleport NPC On End' spawnflag.
Keyvalues
-
Target NPC (
m_iszEntity
) <TargetDestination
>
The name or class name (such as 'npc_zombie') of an NPC to use for this script. -
Pre Action Idle Animation (
m_iszIdle
) <Sequence
>
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. -
Entry Animation (
m_iszEntry
) <Sequence
>
The name of the sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play when the sequence starts, before transitioning to play the main action sequence. -
Action Animation (
m_iszPlay
) <Sequence
>
The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play. -
Post Action Idle Animation (
m_iszPostIdle
) <Sequence
>
The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation. -
Custom Move Animation (
m_iszCustomMove
) <Sequence
>
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. -
Synchronization Group (
sync_group
) <String
>
If set, identifier used to match other scripted sequences to synchronze with (alternative to name-based sync) -
Loop Action Animation? (
m_bLoopActionSequence
) <Boolean
> -
Synch Post Idles? (
m_bSynchPostIdles
) <Boolean
> -
Allow custom interrupt conditions to be set. (
m_bAllowCustomInterruptConditions
) <Boolean
> -
Script Conflict Response (
conflict_response
) <Choices
>
What to do if this scripted sequence begins and the actor is already executing a scripted sequence.- Enqueue
- Interrupt
-
Ground IK Preference (
m_nGroundIKPreference
) <Choices
>
If this NPC has ground IK; whether we disable it for the playthrough of the sequence or not.- No change
- Disable for this sequence
-
Search Radius (0=everywhere) (
m_flRadius
) <Integer
>
Radius to search within for an NPC to use. 0 searches everywhere. -
Repeat Rate ms (
m_flRepeat
) <Integer
> -
Move to Position (
m_fMoveTo
) <Choices
>- No
- Walk
- Run
- Custom movement
- Instantaneous
- No - Turn to Face
-
Next Script (
m_iszNextScript
) <TargetDestination
>
The name of the script to run immediately after this script completes. The NPC will not return to AI between the two scripts. -
Ignore Gravity on NPC during script (
m_bIgnoreGravity
) <Boolean
>
If this is set to 'Yes', the NPC will not be subject to gravity while playing this script. -
Disable NPC collisions during script (
m_bDisableNPCCollisions
) <Boolean
>
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. -
Keep Animgraph Locked after script (
m_bKeepAnimgraphLockedPost
) <Boolean
>
If set, the animgraph will remain locked in the Direct Playback node after this sequence finishes. This is only useful if you have a 'Next Script' set, and you don't want the animgraph to return to Idle during the transition. Note that the 'Next Script' cannot require the NPC to animate/move to it, because the NPC will be unable to move while in the Direct Playback node. In that case, or if you have no 'Next Script' set, selecting this will simply cause the NPC to freeze after it finishes the sequence. -
Spawnflags (
spawnflags
) <Flags
>- Repeatable
- Leave Corpse (if not, fade)
- Start on Spawn
- No Interruptions
- Override AI
- Don't Teleport NPC On End
- Loop in Post Idle
- Priority Script
- Hide Debug Complaints
- Allow other NPC actors to continue after this NPC actor's death
-
On player death (
onplayerdeath
) <Choices
>
What this entity should do if the player dies.- Do Nothing
- Cancel Script and return to AI
-
On NPC actor death (
onnpcdeath
) <Choices
>
What the NPC performing this script should do if it dies.- LEGACY - Use old settings
- Ragdoll immediately
- Perform a death animation
-
Prevent Yaw Update on Finish (
prevent_update_yaw_on_finish
) <Choices
>
By default, when finishing the sequence, the NPC has its ideal yaw updated to maintain the current forward facing. This allows you to prevent that if you want to return to the facing prior to starting the sequence.- No
- Yes
-
Ensure on Nav Mesh on Finish (
ensure_on_navmesh_on_finish
) <Choices
>
When finishing the sequence, if the NPC uses the navmesh, ensure the NPC is on a valid location on the navmesh.- No
- Yes
Inputs
-
BeginSequence <
Void
>
Summons an NPC to act out the scripted sequence. -
MoveToPosition <
Void
>
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 <
Void
>
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
-
OnBeginSequence <
Void
>
Fires when the scripted sequence begins playing. -
OnActionStartOrLoop <
Void
>
Fires when the action animation begins playing and each time it loops. -
OnEndSequence <
Void
>
Fires when the action animation completes. -
OnCancelSequence <
Void
>
Fires when the sequence is cancelled. -
OnCancelFailedSequence <
Void
>
Fires when the sequence is cancelled without ever playing (OnCancelSequence will also fire). -
OnScriptEvent01 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent02 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent03 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent04 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent05 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent06 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent07 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script. -
OnScriptEvent08 <
Void
>
Fires when an AE_SCRIPT_EVENT_FIREEVENT anim event occurs while playing the script.