Ai script conditions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Keyvalues: removed a CONFIRM that seemed obvious to me, fixed formatting resulting in a lot of TODOs)
Line 10: Line 10:


==Keyvalues==
==Keyvalues==
{{ScrollBox|title=Keyvalues|
{{KV Targetname}}
{{KV EnableDisable}}
{{KV|Actor|target_destination|NPC Target.}}
{{KV|Actor|target_destination|NPC Target.}}


Line 27: Line 22:
:* 3 : Combat
:* 3 : Combat


{{KV|Actor is running a script?|choices|{{confirm|Is NPC running a script?}}}}
{{KV|Actor is running a script?|choices|Is NPC running a script?}}
:* 1 : No
:* 1 : No
:* 2 : Yes
:* 2 : Yes
Line 34: Line 29:
{{KV|Required Time|float|Duration of time that all the conditions must be true.}}
{{KV|Required Time|float|Duration of time that all the conditions must be true.}}


{{KV|Minimum time out|float|Minimum time before ''OnConditionsTimeout'' is fired - 0 = never expire}}
{{KV|Minimum time out|float|Minimum}} time before ''OnConditionsTimeout'' is fired - 0 = never expire


{{KV|Maximum time out|float|Maximum time before ''OnConditionsTimeout'' is fired - 0 = ignore}}
{{KV|Maximum time out|float|Maximum}} time before ''OnConditionsTimeout'' is fired - 0 = ignore


{{KV|Actor see Player|choices|Select if actor has to have LOS to player}}
{{KV|Actor see Player|choices|Select if actor has to have LOS to player}}
Line 45: Line 40:
{{KV|Player distance|float|The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.}}
{{KV|Player distance|float|The distance the player must/must not be to the actor. Negative values for NOT, 0 for ignore.}}


{{KV|Player FOV for Actor.|float| Specify angle of view cone in degrees. Negative value = NOT}}
{{KV|Player FOV for Actor.|float|Specify}} angle of view cone in degrees. Negative value = NOT


{{KV|Player FOV to actor is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
{{KV|Player FOV to actor is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
Line 58: Line 53:
{{KV|Target (Optional)|target_destination|Optional entity to include in conditions.}}
{{KV|Target (Optional)|target_destination|Optional entity to include in conditions.}}


{{KV|Actor Sees Target|choices|}}
{{KV|Actor Sees Target|choices|
:* 1 : No
:* 1 : No
:* 2 : Yes
:* 2 : Yes
:* 3 : Don`t care
:* 3 : Don`t care}}


{{KV|Target distance|float|The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.}}
{{KV|Target distance|float|The distance the actor must/must not be to the Target. Negative values for NOT, 0 for ignore.}}
Line 67: Line 62:
{{KV|Player distance from Target|float|The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.}}
{{KV|Player distance from Target|float|The distance the player must/must not be to the Target. Negative values for NOT, 0 for ignore.}}


{{KV|Player FOV for Target|float|Specify angle of view cone in degrees. Negative value = NOT}}
{{KV|Player FOV for Target|float|Specify}} angle of view cone in degrees. Negative value = NOT


{{KV|Player FOV to target is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
{{KV|Player FOV to target is a true view cone|choices|Player's view cone is evaluated as a true cone, not pie slice.}}
Line 97: Line 92:
:* 2 : Yes
:* 2 : Yes
:* 3 : Don`t care
:* 3 : Don`t care
}}


==Flags==
==Flags==

Revision as of 10:33, 19 May 2018

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

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


Minimum State ([todo internal name (i)]) <choices>
Minimum state of selected target NPC - if for example alert is set, while idle it will do nothing
  • 1 : Idle
  • 2 : Alert
  • 3 : Combat


Maximum State ([todo internal name (i)]) <choices>
Maximum state of selected target NPC - if for example alert is set, while combat it will do nothing
  • 1 : Idle
  • 2 : Alert
  • 3 : Combat


Actor is running a script? ([todo internal name (i)]) <choices>
Is NPC running a script?
  • 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>
Minimum time before OnConditionsTimeout is fired - 0 = never expire


Maximum time out ([todo internal name (i)]) <float>
Maximum time before OnConditionsTimeout is fired - 0 = ignore


Actor see Player ([todo internal name (i)]) <choices>
Select if actor has to have LOS to player
  • 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>
Specify angle of view cone in degrees. Negative value = NOT


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>
Specify angle of view cone in degrees. Negative value = NOT


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.