Ai script conditions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Cleanup)
Line 1: Line 1:
{{DISPLAYTITLE:ai_script_conditions}}
{{DISPLAYTITLE:ai_script_conditions}}
{{hl2 point|ai_script_conditions}}
{{hl2 point|ai_script_conditions}}
==Entity description==
==Entity description==
The [[keyvalue]]s for this [[entity]] allow a mapper to define a list of [[condition]]s relating to the player, an NPC and a target (optional), to trigger events when these conditions are fulfilled.
The [[keyvalue]]s for this [[entity]] allow a mapper to define a list of [[condition]]s relating to the player, an NPC and a target (optional), to trigger events when these conditions are fulfilled.


Line 10: Line 10:


==Keyvalues==
==Keyvalues==
{{ScrollBox|title=Keyvalues|
{{KV Targetname}}


* {{KV Targetname}}
{{KV EnableDisable}}


* {{KV EnableDisable}}
{{KV|Actor|target_destination|NPC Target.}}


* '''Actor'''
{{KV|Minimum State|choices|}}
:<target_destination> NPC Target
:* 1 : Idle
:* 2 : Alert
:* 3 : Combat


* '''MinimumState'''
{{KV|Maximum State|choices|}}
:<choices>
:* 1 : Idle
:{| class=standard-table
:* 2 : Alert
! Literal Value || Description
:* 3 : Combat
|-
| 1 || Idle
|-
| 2 || Alert
|-
| 3 || Combat
|}


* '''MaximumState'''
{{KV|Actor is running a script?|choices|}}
:<choices>
:* 1 : No
:{| class=standard-table
:* 2 : Yes
! Literal Value || Description
:* 3 : Don`t care
|-
| 1 || Idle
|-
| 2 || Alert
|-
| 3 || Combat
|}


* '''ScriptStatus'''
{{KV|Required Time|float|Duration of time that all the conditions must be true.}}
: {{boolean}} Actor is running a script?


* '''RequiredTime'''
{{KV|Minimum time out|float|Minimum time before ''OnConditionsTimeout'' is fired. 0 = never expire.}}
: <float> Duration of time that all the conditions must be true.


* '''MinTimeout'''
{{KV|Maximum time out|float|Maximum time before ''OnConditionsTimeout'' is fired. 0 = ignore.}}
: <float> Minimum time before ''OnConditionsTimeout'' is fired. 0 = never expire.


* '''MaxTimeout'''
{{KV|Actor see Player|choices|}}
: <float> Maximum time before ''OnConditionsTimeout'' is fired. 0 = ignore.
:* 1 : No
:* 2 : Yes
:* 3 : Don`t care


* '''ActorSeePlayer'''
{{KV|Player distance|float|The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.}}
: {{boolean}}


* '''PlayerActorProximity'''
{{KV|Player FOV for Actor.|float|Specify angle of view cone in degrees. Negative value = NOT}}
: <float> The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.


* '''PlayerActorFOV'''
{{KV|Player FOV to actor is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
: <float> Specify angle of [[View Cone]] in degrees. Negative value = NOT.
:* 1 : No - Tall pie slice
:* 2 : Yes - True view cone


* '''PlayerActorFOVTrueCone'''
{{KV|Player has LOS to Actor|choices|Checks that the player has clear Line of Sight to the Actor.}}
: <choices> Player's [[View Cone]] is evaluated as a true cone, not pie slice.
:* 1 : No
:* 2 : Yes
:* 3 : Don`t care


* '''PlayerActorLOS'''
{{KV|Target (Optional)|target_destination|Optional entity to include in conditions.}}
: {{boolean}} Checks that the player has clear [[Line of Sight]] to the Actor.


* '''target'''
{{KV|Actor Sees Target|choices|}}
: <target_destination> Optional entity to include in conditions.
:* 1 : No
:* 2 : Yes
:* 3 : Don`t care


* '''ActorSeeTarget'''
{{KV|Target distance|float|The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.}}
: {{boolean}}


* '''ActorTargetProximity'''
{{KV|Player distance from Target|float|The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.}}
: <float> The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.


* '''PlayerTargetProximity'''
{{KV|Player FOV for Target|float|Specify angle of view cone in degrees. Negative value = NOT}}
: <float> The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.


* '''PlayerTargetFOV'''
{{KV|Player FOV to target is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
: <float> Specify angle of [[View Cone]] in degrees. Negative value = NOT.
:* 1 : No - Tall pie slice
:* 2 : Yes - True view cone


* '''PlayerTargetFOVTrueCone'''
{{KV|Player has LOS to Target|choices|Checks that the player has clear Line of Sight to the Target.}}
: {{boolean}} Player's [[View Cone]] is evaluated as a true cone, not pie slice.
:* 1 : No
:* 2 : Yes
:* 3 : Don`t care


* '''PlayerTargetLOS'''
{{KV|Player blocking Actor|choices|Checks that the player is blocking the Actor's path.}}
: {{boolean}} Checks that the player has clear [[Line of Sight]] to the Target.
:* 1 : No
:* 2 : Yes
:* 3 : Don`t care


* '''PlayerBlockingActor'''
{{KV|Actor in Player`s PVS|choices|Checks that the actor is in the player's PVS}}
: {{boolean}} Checks that the player is blocking the Actor's path.
:* 1 : No
* '''{{EP1 add|ActorInPVS}}'''
:* 2 : Yes
: <choices> Checks that the actor is in the player's [[PVS]].
:* 3 : Don`t care
:{| class=standard-table
 
! Literal Value || Description
{{KV|Actor in Vehicle|choices|Checks the actor's state in a vehicle.}}
|-
:* 1 : No
| 0 || No
:* 2 : Yes
|-
:* 3 : Don`t care
| 1 || Yes
 
|-
{{KV|Player in Vehicle|choices|Checks the player's state in a vehicle.}}
| 2 || Don't care
:* 1 : No
|}
:* 2 : Yes
:* 3 : Don`t care
}}


==Flags==
==Flags==
* {{EP1 add|1 : Fire outputs with the Actor as Activator}}
* 1 : Fire outputs with the Actor as Activator
 
==Inputs==
==Inputs==
* {{I Targetname}}
{{I Targetname}}
* {{I EnableDisable}}
 
{{I EnableDisable}}


==Outputs==
==Outputs==
* {{O Targetname}}
{{O Targetname}}
* '''OnConditionsSatisfied'''
 
:Fires when AI conditions satisfied
{{IO|OnConditionsSatisfied|Fires when AI conditions satisfied.}}
* '''OnConditionsTimeout'''
 
:Fires when AI conditions timed out
{{IO|OnConditionsTimeout|Fires when AI conditions timed out.}}
* '''{{EP1 add|NoValidActor}}'''
 
: Fires if/when there are no matching actors in the map.
{{IO|NoValidActor|Fires if/when there are no matching actors in the map.}}
[[Category:AI]][[Category:Entities]]
 
[[Category:AI]]
[[Category:Entities]]

Revision as of 06:09, 4 February 2012

Template:Hl2 point

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

Keyvalues:
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities


Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Actor ([todo internal name (i)]) <targetname>
NPC Target.


Minimum State ([todo internal name (i)]) <choices>
  • 1 : Idle
  • 2 : Alert
  • 3 : Combat


Maximum State ([todo internal name (i)]) <choices>
  • 1 : Idle
  • 2 : Alert
  • 3 : Combat


Actor is running a script? ([todo internal name (i)]) <choices>
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Required Time ([todo internal name (i)]) <float>
Duration of time that all the conditions must be true.


Minimum time out ([todo internal name (i)]) <float>


Maximum time out ([todo internal name (i)]) <float>


Actor see Player ([todo internal name (i)]) <choices>
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Player distance ([todo internal name (i)]) <float>
The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.


Player FOV for Actor. ([todo internal name (i)]) <float>


Player FOV to actor is a true view cone ([todo internal name (i)]) <choices>
Player's view cone is evaluated as a true cone, not pie slice.
  • 1 : No - Tall pie slice
  • 2 : Yes - True view cone


Player has LOS to Actor ([todo internal name (i)]) <choices>
Checks that the player has clear Line of Sight to the Actor.
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Target (Optional) ([todo internal name (i)]) <targetname>
Optional entity to include in conditions.


Actor Sees Target ([todo internal name (i)]) <choices>
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Target distance ([todo internal name (i)]) <float>
The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.


Player distance from Target ([todo internal name (i)]) <float>
The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.


Player FOV for Target ([todo internal name (i)]) <float>


Player FOV to target is a true view cone ([todo internal name (i)]) <choices>
Player's view cone is evaluated as a true cone, not pie slice.
  • 1 : No - Tall pie slice
  • 2 : Yes - True view cone


Player has LOS to Target ([todo internal name (i)]) <choices>
Checks that the player has clear Line of Sight to the Target.
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Player blocking Actor ([todo internal name (i)]) <choices>
Checks that the player is blocking the Actor's path.
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Actor in Player`s PVS ([todo internal name (i)]) <choices>
Checks that the actor is in the player's PVS
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Actor in Vehicle ([todo internal name (i)]) <choices>
Checks the actor's state in a vehicle.
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care


Player in Vehicle ([todo internal name (i)]) <choices>
Checks the player's state in a vehicle.
  • 1 : No
  • 2 : Yes
  • 3 : Don`t care

Flags

  • 1 : Fire outputs with the Actor as Activator

Inputs

EnableDisable:

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

Outputs

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.