Scripted sequence: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(Structure and Formatting)
Line 1: Line 1:
scripted_sequence
==Entity Description==
'''Entity Name:''' scripted_sequence


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:
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:


1) Move to position using the specified movement animation. If 'Move to Position' is set to NONE, skip to step 2.
'''1.)''' Move to position using the specified movement animation. If 'Move to Position' is set to NONE, skip to step 2.
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.
3) Fire the OnBeginSequence output.
4) Play the action animation. If no action animation is specified, skip to step 5.
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.
6) Fire the OnEndSequence output.
7) 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.
'''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.
 
'''3.)''' Fire the OnBeginSequence output.
 
'''4.)''' Play the action animation. If no action animation is specified, skip to step 5.
 
'''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.


KEYS
'''6.)''' Fire the OnEndSequence output.


Name targetname <target_source> The name that other entities refer to this entity by.
'''7.)''' If a next script to play is specified, hand the NPC to the next script and repeat this process for that script.


Parent parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
The MoveToPosition input runs steps 1 and 2, then waits while playing the pre-action idle animation until the BeginSequence input is received.


Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
==Entity Values==
===Keys===


Target NPC m_iszEntity <target_destination> The name or class name (such as 'npc_zombie') of an NPC to use for this script.
'''targetname''' ''<target_source>'' The name that other entities refer to this entity by.


Pre Action Idle Animation m_iszIdle <string> 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.
'''parentname''' ''<target_destination>'' The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.


Action Animation m_iszPlay <string> The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.
'''Pitch Yaw Roll (Y Z X) angles''' ''<angle>'' This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.


Post Action Idle Animation m_iszPostIdle <string> The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation.
'''m_iszEntity''' ''<target_destination>'' Target NPC. The name or class name (such as 'npc_zombie') of an NPC to use for this script.


Custom Move Animation m_iszCustomMove <string> 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.
'''m_iszIdle''' ''<string>'' Pre Action Idle Animation. 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.


Search Radius (0=everywhere) m_flRadius <integer> Radius to search within for an NPC to use. 0 searches everywhere.
'''m_iszPlay''' ''<string>'' Action Animation. The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.


Repeat Rate ms m_flRepeat <integer>  
'''m_iszPostIdle''' ''<string>'' Post Action Idle Animation. The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation.


Move to Position m_fMoveTo <choices>
'''m_iszCustomMove''' ''<string>'' Custom Move 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.


Next Script m_iszNextScript <target_destination> The name of the script to run immediately after this script completes. The NPC will not return to AI between the two scripts.
'''m_flRadius''' ''<integer(0=everywhere)>'' Search Radius. Radius to search within for an NPC to use. 0 searches everywhere.


Minimum DX Level mindxlevel <choices>  
'''m_flRepeat''' ''<integer>'' Repeat Rate ms


Maximum DX Level maxdxlevel <choices>  
'''m_fMoveTo''' ''<choices>'' Move to Position


spawnflags spawnflags <flags>  
'''m_iszNextScript''' ''<target_destination>'' Next Script. The name of the script to run immediately after this script completes. The NPC will not return to AI between the two scripts.


'''mindxlevel''' ''<choices>'' Minimum DX Level


INPUTS
'''maxdxlevel''' ''<choices>'' Maximum DX Level


Kill Removes this entity from the world.
'''spawnflags''' ''<flags>'' Spawn Flags


KillHierarchy Removes this entity and all its children from the world.
===Inputs===


AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
'''Kill''' Removes this entity from the world.


FireUser1 Causes this entity's OnUser1 output to be fired.
'''KillHierarchy''' Removes this entity and all its children from the world.


FireUser2 Causes this entity's OnUser2 output to be fired.
'''AddOutput''' ''<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>'' Adds an entity I/O connection to this entity. Very dangerous, use with care.


FireUser3 Causes this entity's OnUser3 output to be fired.
'''FireUser1''' Causes this entity's OnUser1 output to be fired.


FireUser4 Causes this entity's OnUser4 output to be fired.
'''FireUser2''' Causes this entity's OnUser2 output to be fired.


SetParent <string> Changes the entity's parent in the movement hierarchy.
'''FireUser3''' Causes this entity's OnUser3 output to be fired.


SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
'''FireUser4''' Causes this entity's OnUser4 output to be fired.


ClearParent Removes this entity from the the movement hierarchy, leaving it free to move independently.
'''SetParent''' ''<string>'' Changes the entity's parent in the movement hierarchy.


BeginSequence Summons an NPC to act out the scripted sequence.
'''SetParentAttachment''' ''<string>'' Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.


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.
'''ClearParent''' Removes this entity from the the movement hierarchy, leaving it free to move independently.


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.
'''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.


OUTPUTS
'''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.


OnUser1 Fired in response to FireUser1 input.
===Outputs===
'''OnUser1''' Fired in response to FireUser1 input.


OnUser2 Fired in response to FireUser2 input.
'''OnUser2''' Fired in response to FireUser2 input.


OnUser3 Fired in response to FireUser3 input.
'''OnUser3''' Fired in response to FireUser3 input.


OnUser4 Fired in response to FireUser4 input.
'''OnUser4''' Fired in response to FireUser4 input.


OnBeginSequence Fires when the action animation begins playing.
'''OnBeginSequence''' Fires when the action animation begins playing.


OnEndSequence Fires when the action animation completes.
'''OnEndSequence''' Fires when the action animation completes.


OnScriptEvent01 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 1  in the QC.
'''OnScriptEvent01''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 1  in the QC.


OnScriptEvent02 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 2  in the QC.
'''OnScriptEvent02''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 2  in the QC.


OnScriptEvent03 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 3  in the QC.
'''OnScriptEvent03''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 3  in the QC.


OnScriptEvent04 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 4  in the QC.
'''OnScriptEvent04''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 4  in the QC.


OnScriptEvent05 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 5  in the QC.
'''OnScriptEvent05''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 5  in the QC.


OnScriptEvent06 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 6  in the QC.
'''OnScriptEvent06''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 6  in the QC.


OnScriptEvent07 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 7  in the QC.
'''OnScriptEvent07''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 7  in the QC.


OnScriptEvent08 Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 8  in the QC.
'''OnScriptEvent08''' Fires when a 'trigger' anim event occurs while playing the script. Use  event 1003 framenum 8  in the QC.

Revision as of 19:51, 3 July 2005

Entity Description

Entity Name: scripted_sequence

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:

1.) Move to position using the specified movement animation. If 'Move to Position' is set to NONE, skip to step 2.

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.

3.) Fire the OnBeginSequence output.

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

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.

6.) Fire the OnEndSequence output.

7.) 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.

Entity Values

Keys

targetname <target_source> The name that other entities refer to this entity by.

parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.

Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

m_iszEntity <target_destination> Target NPC. The name or class name (such as 'npc_zombie') of an NPC to use for this script.

m_iszIdle <string> Pre Action Idle Animation. 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.

m_iszPlay <string> Action Animation. The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.

m_iszPostIdle <string> Post Action Idle Animation. The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation.

m_iszCustomMove <string> Custom Move 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.

m_flRadius <integer(0=everywhere)> Search Radius. Radius to search within for an NPC to use. 0 searches everywhere.

m_flRepeat <integer> Repeat Rate ms

m_fMoveTo <choices> Move to Position

m_iszNextScript <target_destination> Next Script. The name of the script to run immediately after this script completes. The NPC will not return to AI between the two scripts.

mindxlevel <choices> Minimum DX Level

maxdxlevel <choices> Maximum DX Level

spawnflags <flags> Spawn Flags

Inputs

Kill Removes this entity from the world.

KillHierarchy Removes this entity and all its children from the world.

AddOutput <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)> Adds an entity I/O connection to this entity. Very dangerous, use with care.

FireUser1 Causes this entity's OnUser1 output to be fired.

FireUser2 Causes this entity's OnUser2 output to be fired.

FireUser3 Causes this entity's OnUser3 output to be fired.

FireUser4 Causes this entity's OnUser4 output to be fired.

SetParent <string> Changes the entity's parent in the movement hierarchy.

SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.

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

OnUser1 Fired in response to FireUser1 input.

OnUser2 Fired in response to FireUser2 input.

OnUser3 Fired in response to FireUser3 input.

OnUser4 Fired in response to FireUser4 input.

OnBeginSequence Fires when the action animation begins playing.

OnEndSequence Fires when the action animation completes.

OnScriptEvent01 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 1 in the QC.

OnScriptEvent02 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 2 in the QC.

OnScriptEvent03 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 3 in the QC.

OnScriptEvent04 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 4 in the QC.

OnScriptEvent05 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 5 in the QC.

OnScriptEvent06 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 6 in the QC.

OnScriptEvent07 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 7 in the QC.

OnScriptEvent08 Fires when a 'trigger' anim event occurs while playing the script. Use event 1003 framenum 8 in the QC.