ai_script_conditions

From Valve Developer Community

Jump to: navigation, search

Contents

Entity Description

The keyvalues for this entity allow a mapper to define a list of conditions relating to the player, an NPC and a target (optional), to trigger events when these conditions are fulfilled.

For an example of its use, see d2_coast_03 (when Odessa gives Gordon the rocket launcher).

Fired only once, automatically, when the condition is first fulfilled, then disables itself. Use "Enable" inputs to recheck conditions.

Keyvalues

  • Targetname:

Name <string>
The targetname other entities refer to this entity by.
  • EnableDisable:

Start Disabled <bool>
Stay dormant until activated (probably with the Enable input).
  • Actor
<target_destination> NPC Target
  • MinimumState
<choices>
Literal Value Description
1 Idle
2 Alert
3 Combat
  • MaximumState
<choices>
Literal Value Description
1 Idle
2 Alert
3 Combat
  • ScriptStatus
<boolean> Actor is running a script?
  • RequiredTime
<float> Duration of time that all the conditions must be true.
  • MinTimeout
<float> Minimum time before OnConditionsTimeout is fired. 0 = never expire.
  • MaxTimeout
<float> Maximum time before OnConditionsTimeout is fired. 0 = ignore.
  • ActorSeePlayer
<boolean>
  • PlayerActorProximity
<float> The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.
  • PlayerActorFOV
<float> Specify angle of View Cone in degrees. Negative value = NOT.
  • PlayerActorFOVTrueCone
<choices> Player's View Cone is evaluated as a true cone, not pie slice.
  • PlayerActorLOS
<boolean> Checks that the player has clear Line of Sight to the Actor.
  • target
<target_destination> Optional entity to include in conditions.
  • ActorSeeTarget
<boolean>
  • ActorTargetProximity
<float> The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.
  • PlayerTargetProximity
<float> The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.
  • PlayerTargetFOV
<float> Specify angle of View Cone in degrees. Negative value = NOT.
  • PlayerTargetFOVTrueCone
<boolean> Player's View Cone is evaluated as a true cone, not pie slice.
  • PlayerTargetLOS
<boolean> Checks that the player has clear Line of Sight to the Target.
  • PlayerBlockingActor
<boolean> Checks that the player is blocking the Actor's path.
  • ActorInPVS
<choices> Checks that the actor is in the player's PVS.
Literal Value Description
0 No
1 Yes
2 Don't care

Flags

  • 1 : Fire outputs with the Actor as Activator

Inputs

  • Targetname:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
  • EnableDisable:

Enable
Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

  • Targetname:

OnUser1 to OnUser4
Fired in response to the FireUser inputs; see User Inputs and Outputs.
OnKilled (New with Left 4 Dead)
Fired when the entity is killed and removed from the game.
  • OnConditionsSatisfied
Fires when AI conditions satisfied
  • OnConditionsTimeout
Fires when AI conditions timed out
  • NoValidActor
Fires if/when there are no matching actors in the map.
Personal tools