You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date.
Click here to see the current revision of this page.
The scripted_sequence entity allows you to make a monster entity move to a specific location and/or perform a given animation.
Attributes
Target (target) - When this entity is triggered, it will trigger the entity specified in Target.
Delay before trigger (delay) - Target and KillTarget will be triggered this many seconds after the animation is performed.
KillTarget (killtarget) - When the sequence is completed, the entity that is specified in KillTarget will be removed from the game.
Name (targetname) - Name is a general attribute used to identify entities.
Pitch Yaw Roll (Y Z X) (angles) - The monster will turn to face the given yaw angle before performing the animation. Pitch and roll are not used.
Target Monster (m_iszEntity) - The name of the monster entity that this sequence affects. You can also input a monster type (monster_scientist, for example). (Only one monster will be chosen to follow the sequence.)
Action Animation (m_iszPlay) - The name of the animation that will be performed by Target Monster.
Idle Animation (m_iszIdle) - The name of an animation you want Target Monster to perform on a loop until the scripted_sequence is triggered. See notes below for how this changes the usage of the entity.
Search Radius (m_flRadius) - If you input a monster type into Target Monster, the entity will pick a monster within this radius of the entity to follow the sequence. If none are within the radius, the first monster to enter the radius will follow the sequence.
Repeat Rate ms (m_flRepeat) - How often to check if a monster is within the search radius. A check will be made even if search radius is zero, so set this to a large value if it's not used.
Move to Position (m_fMoveTo) - Sets how (or if) the monster moves before performing the animation:
No (0) - The monster will not move or turn. It will perform the animation wherever it is.
Walk (1) - The monster will walk to the scripted_sequence, then perform the animation.
Run (2) - The monster will run to the scripted_sequence, then perform the animation.
Instantaneous (4) - The monster will instantly warp to the location of the scripted_sequence and perform the animation.
No - Turn to Face (5) - The monster will not move, but will turn to the scripted_sequence's angle before performing the animation.
Flags
Repeatable (4) - If enabled, the sequence can be repeated more than once. Otherwise the entity will be removed once the sequence is complete.
Leave Corpse (8) - Seemingly unused.
No Interruptions (32) - If enabled, the sequence cannot be interrupted. The monster will ignore damage until the sequence is complete, as with the aiscripted_sequence entity.
Override AI (64) - If enabled, the script will possess its target even when the monster is in the combat state at the moment of the call.
No Script Movement (128) - If enabled, when the sequence is completed, the monster will be placed back where the Action Animation started (if the animation would cause the monster to move).
Notes
Making use of the Idle Animation field will change how the entity is used. The monster will move at the start of the level ("Walk" and "Run" movement types will not function as intended) and then perform their idle animation on a loop. When the scripted_sequence is triggered, the monster will perform their action animation.
You can use a model viewer to see the animations available to each monster.
If using the "Instantaneous" movement type with no Idle Animation, the script will freeze the monster after it is teleported. Trigger the script again to continue the script. The second trigger cannot be at the same time as the first trigger. However, 0.1 second delay is already enough.
The script that uses Idle Animation must provide Action Animation too. Otherwise the script will be considered finished after the monster finished the movement (if there's any).
If the script that features Idle Animation gets interrupted (e.g. by damage done to the possessed monster), the activation of the script via some trigger will make the monster play the Idle Animation again. This may lead to weird situations.
the flowchart just demonstrates how confusing it really apparently is