Scripted sequence: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 22: Line 22:
The MoveToPosition input runs steps 1 and 2, then waits while playing the pre-action idle animation until the BeginSequence input is received.
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==
==Keyvalues==
===Keys===


'''targetname''' ''<target_source>'' The name that other entities refer to this entity by.
* {{kv targetname}}


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


'''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.
* {{kv angles}}


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


'''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_iszEntity'''
: <target_destination> The name or class name (such as 'npc_zombie') of an NPC to use for this script.


'''m_iszPlay''' ''<string>'' Action Animation. The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.
* '''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.


'''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_iszPlay'''
: <string> The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.


'''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_iszPostIdle'''
: <string> The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action animation.


'''m_flRadius''' ''<integer(0=everywhere)>'' Search Radius. Radius to search within for an NPC to use. 0 searches everywhere.
* '''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_flRepeat''' ''<integer>'' Repeat Rate ms
* '''m_flRadius'''
: <integer> Radius to search within for an NPC to use. 0 searches everywhere.


'''m_fMoveTo''' ''<choices>'' Move to Position
* '''m_flRepeat'''
: <integer> Repeat Rate ms


'''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.
* '''m_fMoveTo'''
: <choices> Move to Position"
{|
! Literal Value || Description
|-
| 0 || No
|-
| 1 || Walk
|-
| 2 || Run
|-
| 3 || Custom movement
|-
| 4 || Instantaneous
|-
| 5 || No - Turn to Face


'''mindxlevel''' ''<choices>'' Minimum DX Level
* '''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.


'''maxdxlevel''' ''<choices>'' Maximum DX Level
==Flags==


'''spawnflags''' ''<flags>'' Spawn Flags
* 4 : Repeatable


===Inputs===
* 8 : Leave Corpse


'''Kill''' Removes this entity from the world.
* 16 : Start on Spawn


'''KillHierarchy''' Removes this entity and all its children from the world.
* 32: No Interruptions


'''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.
* 64: Override AI


'''FireUser1''' Causes this entity's OnUser1 output to be fired.
* 128: No Script Movement


'''FireUser2''' Causes this entity's OnUser2 output to be fired.
* 256: Loop in Post Idle


'''FireUser3''' Causes this entity's OnUser3 output to be fired.
* 512: Priority Script


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


'''SetParent''' ''<string>'' Changes the entity's parent in the movement hierarchy.
* {{i targetname}}


'''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.
* {{i parentname}}


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


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


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


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


===Outputs===
* {{o targetname}}
'''OnUser1''' Fired in response to FireUser1 input.


'''OnUser2''' Fired in response to FireUser2 input.
* '''OnBeginSequence'''
: Fires when the action animation begins playing.


'''OnUser3''' Fired in response to FireUser3 input.
* '''OnEndSequence'''
: Fires when the action animation completes.


'''OnUser4''' Fired in response to FireUser4 input.
* '''OnScriptEvent''(01-08)'''''
: Fires when a 'trigger' anim event occurs while playing the script. Use { event 1003 framenum ''(1-8)'' } in the QC.


'''OnBeginSequence''' Fires when the action animation begins playing.
[[Category:Entities]]
 
'''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.

Revision as of 23:08, 11 July 2005

Template:Wrongtitle

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.

Keyvalues

  • m_iszEntity
<target_destination> The name or class name (such as 'npc_zombie') of an NPC to use for this script.
  • 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.
  • m_iszPlay
<string> The name of the main sequence (such as 'reload02') or activity (such as 'ACT_RELOAD') to play.
  • m_iszPostIdle
<string> The name of the sequence (such as 'idle01') or activity (such as 'ACT_IDLE') to play after the action 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_flRadius
<integer> Radius to search within for an NPC to use. 0 searches everywhere.
  • m_flRepeat
<integer> Repeat Rate ms
  • m_fMoveTo
<choices> Move to Position"
Literal Value Description
0 No
1 Walk
2 Run
3 Custom movement
4 Instantaneous
5 No - Turn to Face
  • 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.

Flags

  • 4 : Repeatable
  • 8 : Leave Corpse
  • 16 : Start on Spawn
  • 32: No Interruptions
  • 64: Override AI
  • 128: No Script Movement
  • 256: Loop in Post Idle
  • 512: Priority Script

Inputs

  • 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

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