Skip to main content

aiscripted_sequence

aiscripted_sequence icon
Point entity

An aiscripted_sequence makes a monster move to its position and play an animation there.

It works like a scripted_sequence, with three differences: it takes a monster in any state, even a monster that is fighting, it can run without an Action Animation, and other scripts with the same Name don't wait for it.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Target Monsterm_iszEntity

Names the monster that plays the script, as the Name of a monster or as a class name such as monster_human_grunt. A class name takes a free monster of that class within Search Radius. Search target monster by... sets which of the two the script tries.

Search Radiusm_flRadius

Sets how far from the script, in units, it looks for a monster when Target Monster is a class name. A monster found by its name can be anywhere, unless Test against search radius is "Always".

If you leave this key empty, it is 0 and a class name finds no monster. The Entity to attack of a scripted_action still searches 512 units.

Default 512
Move to Positionm_fMoveTo

Sets how the monster gets to the script's position before it plays.

  • No (0) - It plays where it stands
  • Walk (1) - It walks to the position
  • Run (2) - It runs to the position
  • Instantaneous (4) - The monster appears at the position, facing the script's angle, at the moment the script takes it
  • No - Turn to Face (5) - It plays where it stands and turns to face as Turn mode says
  • Teleport (7) - Like Instantaneous, but the monster appears at the position a moment later, when it starts the script, not when the script takes it
Default No (0)
Fire on Possessionm_iszFireOnPossessed

Fires when the script takes its monster, with the script as the activator.

Fire after movingm_iszFireOnBegin

With Move to Position "Walk" or "Run", fires when the monster reaches the mark and the script can start, with the script as the activator.

Fire on Animation startm_iszFireOnAnimStart

Fires when the Action Animation starts, or for a scripted_action when the action starts, with the script as the activator.

Mastermaster

Names a master, and while the master is off, the script waits and looks again every second.

Interruption policym_interruptionPolicy

Sets what breaks the monster out of the script.

  • Default (by any damage) (0) - Any damage breaks it out
  • No Interruptions (same as flag) (1) - Nothing breaks it out, as with the flag No Interruptions
  • By Death Only (2) - Only its death breaks it out
Default Default (by any damage) (0)
TakeDamage policym_takeDamagePolicy

Sets what damage does to the monster while the script holds it.

  • As usual (0) - Damage hurts it as usual
  • Invulnerable during script (1) - It can't be hurt during the script
  • Non-lethal damage (2) - Damage hurts it but can't kill it
Default As usual (0)
Search target monster by...m_searchPolicy

Sets whether Target Monster is read as a name, a class name or both.

  • Targetname, then classname (0)
  • Targetname only (1)
  • Classname only (2)
Default Targetname, then classname (0)
Test against search radiusm_applySearchRadius

Sets when the Search Radius applies.

  • When searching by classname (0) - Only when the script looks for a monster by its class name
  • Always (1) - Also for a monster found by its name, which then has to be within the Search Radius too
Default When searching by classname (0)
Required MonsterStaterequired_state

Sets the state a monster has to be in for the script to take it.

  • Any (0)
  • Idle (1)
  • Combat (2)
  • Alert, Hunt (3)
  • Non-combat (Idle, Alert, Hunt) (4)
Default Any (0)
Move to target's radiusmoveto_radius

With Move to Position "Walk" or "Run", the monster stops this close to the mark and plays there.

If you leave this key empty or set 0, the monster walks onto the mark.

Turn modem_fTurnType

Sets how the monster turns before it plays, with Move to Position "Walk", "Run" or "No - Turn to Face". With "Teleport" or "Instantaneous", it takes the script's angle, and with "No", it doesn't turn.

  • Match turn target's angle (0) - It turns to the angle of the script
  • Turn to target (1) - It turns to face the script
  • Don't Turn (2) - It doesn't turn
Default Match turn target's angle (0)
Prioritym_iPriority

Sets whether the script can take a monster that is playing another script.

  • Normal (0) - It only takes a monster that plays no other script
  • Override other sequences (4) - It also takes a monster that is playing another script
Default Normal (0)
Repeat action X more timesm_iRepeats

Sets how many more times the Action Animation, or the action of a scripted_action, plays.

Default 0
Action Animationm_iszPlay

Sets the name of the animation the monster plays once it reaches the script, as the model names it.

If you leave this key empty, the monster plays nothing, and the script ends at once and fires its Target.

Idle Animationm_iszIdle

Sets the animation the monster plays once it reaches the script, until you trigger the script. With an idle animation, a script that has a Name takes its monster when the map starts.

If you leave this key empty, a script that has a Name doesn't take its monster until you trigger it.

AI Schedule when donem_iFinishSchedule

Sets what the monster does when the script ends.

  • Default AI (0) - The monster goes back to what it was doing
  • Ambush (1) - The monster stays where it is and waits until it sees an enemy
Default Default AI (0)

Flags​

4Repeatable

The script stays after it ends, so you can run it again. Without this flag, it removes itself when its animation ends

8Leave Corpse

A monster that dies during the script leaves its body where it fell. Without this flag, the body fades out

32No Interruptions

The monster finishes the script even when it is hurt or sees an enemy

1024Auto-search

The script looks for its monster in its Search Radius when the map starts, as a script without a Name does, even though it has a name

4096Try search once

When you trigger the script, it looks for its monster only once, and if the monster isn't there, it gives up. Without this flag, it looks again every second

8192Don't reset head turn

A Scientist or a Cop keeps their head turned the way it was while the script plays. Without this flag, they look straight ahead

16384Force idle animation looping

The Idle Animation starts again each time it ends, even when the model doesn't loop it

32768Remove on interruption

The script removes itself when its monster breaks out of it, for example when the monster is hurt or sees an enemy

65536Don't Drop to Floor

After the animation, the monster stays at the height where the animation ended. Without this flag, it drops to the floor

131072Allow stuck

After the animation, the monster keeps its end position even inside a wall or another solid. Without this flag, it goes back to where it started

262144Allow unnamed idle

A script without a Name that has an Idle Animation plays the idle and waits for a trigger before its action. Without this flag, it starts at once

524288Allow Take Damage TriggerCondition

The monster's Take Damage trigger condition fires when the monster is hurt during the script, even while the script ignores interruptions

Notes​

  • If the monster's model has no animation with the name in Action Animation, the monster plays its first animation, and with developer 1 set in the console, the console reports it

See also​

Changes since 1.38​

  • You can use the new keys and flags that every scripted sequence has in SBO 2.0.0, from Fire on Possession to Repeat action X more times, and the flags from Auto-search on
  • A script removed by a KillTarget while its monster waits for it or plays it lets the monster go. In SBO 1.38, the monster kept a link to the removed script, which could crash the server