The scripted_sequence point entity allows you to make a monster entity move to a specific location and/or perform a given animation.
This entity is also the base of aiscripted_sequence where some changes has been made to override AI related stuff.
Target (target) - The entity name to trigger after the scripted animation is performed (or, in case the "Action Animation" is not specified, after the monster moved to the script).
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. If several scripts share the same name and their Move to Position is set to Walk or Run, the monsters will wait for each others movement before playing the action animation and finishing the sequence. This can be used for animation synchronization. It's recommended to avoid assigning the same name to scripts if such functionality is not needed.
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 classname (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 classname 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.
AI Schedule when done (m_iFinishSchedule) - Does nothing for scripted_sequence but used by it's aiscripted_sequence counterpart.
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) - If enabled, the monster leave it's corpse instead of fading out. This is only noticeable in-between two scripted_sequence when the monster is on a dying state.
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, as with the aiscripted_sequence entity.
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).
No Reset Entity (256) (Opposing Force specific) - If enabled, the monster animation will not automatically reset (usually to idle animation) when the sequence is finished. This allows for smooth transitions between similar animations. Example where it's appropriate to use this flag: mic_idle animations of Opposing Force human grunt.
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".
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.
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, like zombies or scientists returning to sitting animation again. To avoid this situation set the monster's Trigger Condition to "Take Damage" and set TriggerTarget to call the trigger_relay that would kill the trigger entity (e.g. trigger_once) which is supposed to fire the scripted_sequence. Do not kill the scripted_sequence itself as it might lead to crashes!
If the script has "Idle Animation" and "Move to Position" is set to "No - Turn to Face", the idle animation won't stop playing when the scripted_sequence is triggered. Instead just put the angle you need in monster's properties.
Animations may have events attached to specific frames of the animation.
Some animations automatically kill the entity using event ID 1000. Others make the animation uninterruptible with event ID 1001.
Some of the scientist's animations have events that make them speak specific sentence files, eliminating the need for separate scripted_sentences to be fired and timed to the scripted_sequence.
Be aware that event ID 1003 in animations will try to trigger entities in your map. Check with Half-Life Asset Manager for such events in the animation, and avoid naming any entity in the map matching the value of event 1003s if such effect is not intended.
The monster who is still playing the dying animation can be possessed by a script. This can lead to weird situations when the monster who is supposed to be dead runs to the script spot and then fades away. The reason why this happens is the CBaseMonsteer::IsAlive function which is used in CBaseMonster::CanPlaySequence and doesn't do the correct check.
This is a flowchart to visualize this complicated entity. Click here for full view.