Aiscripted schedule: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (links)
No edit summary
Line 1: Line 1:
{{wrongtitle|title=aiscripted_schedule}}
{{toc-right}}


==Entity Description==
[[Image:{{PAGENAME}}.png|left]]
[[Image:{{PAGENAME}}.png|left]]Issues a command to an [[NPC]] without taking the NPC out of its [[AI]]. This does not seize control of the NPC as a [[scripted_sequence]] does.{{clr}}


==Keyvalues==
{{base point|aiscripted_schedule}} It issues a command to an [[NPC]] without suppressing its normal AI routines.{{clearleft}}
* {{KV Targetname}}
 
* '''m_iszEntity'''
==See also==
: <target_destination> The name or classname of an NPC to use.
* '''m_flRadius'''
: <float> Radius to search within for an NPC to use. 0 searches everywhere.
* '''graball'''
: {{boolean}} Whether to grab all matching NPCs in the specified radius, instead of just one.
* '''forcestate'''
: <choices> AI state to set
:{| class=standard-table
! Literal Value || Description
|-
| 0 || <None>
|-
| 1 || Set state to IDLE
|-
| 2 || Set state to ALERT
|-
| 3 || Set state to COMBAT
|}


* '''schedule'''
*[[scripted_sequence]] (for seizing complete control of the entity)
: <choices> Schedule to run
*[[Assaults]] (for combat)
:{| class=standard-table
*[[npc_citizen_fleeing]] - A prefab that demonstrates scheduled behavior.
! Literal Value || Description
|-
| 0 || <None>
|-
| 1 || Walk to Goal Entity
|-
| 2 || Run to Goal Entity
|-
| 3 || Set enemy to Goal Entity
|-
| 4 || Walk Goal Path
|-
| 5 || Run Goal Path
|-
| 6 || Set enemy to Goal Entity AND Run to Goal Entity
|}


* '''interruptability'''
==Keyvalues==
: <choices>
:{| class=standard-table
! Literal Value || Description
|-
| 0 || General
|-
| 1 || Damage or Death
|-
| 2 || Death
|}


* '''goalent'''
{{KV|Target NPC|targetname|The name or classname of an NPC to command.}}
: <target_destination> Provides the name of a schedule-specific goal entity. (See the ''shedule'' (''Schedule to run'') keyvalue.)
{{KV|Search Radius (0<nowiki>=</nowiki>everywhere)|float|Radius to search within for an NPC to use.}}
{{KV|All in radius|bool|Whether to grab all matching NPCs in the specified radius, instead of just the first one found.}}
{{KV|AI state to set|choices|Overrides the NPC's current alertness state.
:* <None>
:* Idle
:* Alert
:* Combat
}}
{{KV|Schedule to run|choices|Which AI schedule to run.
:* <None>
:* Walk to Goal Entity
:* Run to Goal Entity
:* Set enemy to Goal Entity
:* Walk Goal [[path_corner|Path]]
:* Run Goal Path
:* Set enemy to Goal Entity AND Run to Goal Entity
}}
{{KV|Interruptability|choices|What can cause the NPC to give up on this schedule?
:* General
:* Damage or Death
:* Death
}}
{{KV|Goal entity|targetname|Provides the name of a goal entity, used by some schedules.}}
{{KV Targetname}}


==Flags==
==Flags==
* 4 : Repeatable
 
* 1024 : Search Cyclically
* Repeatable
: If the target parameters can apply to more than one entity, the ''aiscripted_schedule'' will normally select one of these targets to affect at random each time it is triggered. Checking this flag will instead make it cycle through a list of them, affecting all the entities in order as it is triggered. This is useful for making sure that every member of the group will eventually be affected, especially when targeting the schedule to affect multiple spawns.
* Search Cyclically: If the target parameters can apply to more than one entity, the aiscripted_schedule will normally select one of these targets to affect at random each time it is triggered. Checking this flag will instead make it cycle through a list of them, affecting all the entities in order as it is triggered. This is useful for making sure that every member of the group will eventually be affected, especially when targeting the schedule to affect multiple spawns.
* 2048 : Don't Complain
* Don't Complain: the following messages will be suppressed:
: If set, the following messages will be suppressed:
**<code>Found <entity>, but can't play!</code>
:*Found <entity>, but can't play!
**<code>ScheduledMoveToGoalEntity to goal entity <entity> failed, can't execute script <this></code>
:*ScheduledMoveToGoalEntity to goal entity <entity> failed<br>Can't execute script <this>
**<code>ScheduledFollowPath to goal entity <entity> failed, can't execute script <this></code>
:*ScheduledFollowPath to goal entity <entity> failed<br>Can't execute script <this>


==Inputs==
==Inputs==
* {{I Targetname}}
 
* '''StartSchedule'''
{{IO|StartSchedule|Starts the scripted schedule. This will first locate an NPC that matches the given target, then tell the NPC to run the specified schedule.}}
: Starts the scripted schedule. This will first locate an NPC that matches the given target, then tell the NPC to run the specified schedule.
{{I Targetname}}


==Outputs==
==Outputs==
* {{O Targetname}}


==See also==
{{O Targetname}}
*[[scripted_sequence]]
*[[Assaults]] (for combat)
*[[npc_citizen_fleeing]] - A prefab that demonstrates scheduled behavior.


[[category:AI]]
[[category:AI]]
[[category:Entities]]

Revision as of 14:57, 29 June 2011

Aiscripted schedule.png

Template:Base point It issues a command to an NPC without suppressing its normal AI routines.

See also

Keyvalues

Target NPC ([todo internal name (i)]) <targetname>
The name or classname of an NPC to command.
Search Radius (0=everywhere) ([todo internal name (i)]) <float>
Radius to search within for an NPC to use.
All in radius ([todo internal name (i)]) <boolean>
Whether to grab all matching NPCs in the specified radius, instead of just the first one found.
AI state to set ([todo internal name (i)]) <choices>
Overrides the NPC's current alertness state.
  • <None>
  • Idle
  • Alert
  • Combat
Schedule to run ([todo internal name (i)]) <choices>
Which AI schedule to run.
  • <None>
  • Walk to Goal Entity
  • Run to Goal Entity
  • Set enemy to Goal Entity
  • Walk Goal Path
  • Run Goal Path
  • Set enemy to Goal Entity AND Run to Goal Entity
Interruptability ([todo internal name (i)]) <choices>
What can cause the NPC to give up on this schedule?
  • General
  • Damage or Death
  • Death
Goal entity ([todo internal name (i)]) <targetname>
Provides the name of a goal entity, used by some schedules.
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

Flags

  • Repeatable
  • Search Cyclically: If the target parameters can apply to more than one entity, the aiscripted_schedule will normally select one of these targets to affect at random each time it is triggered. Checking this flag will instead make it cycle through a list of them, affecting all the entities in order as it is triggered. This is useful for making sure that every member of the group will eventually be affected, especially when targeting the schedule to affect multiple spawns.
  • Don't Complain: the following messages will be suppressed:
    • Found <entity>, but can't play!
    • ScheduledMoveToGoalEntity to goal entity <entity> failed, can't execute script <this>
    • ScheduledFollowPath to goal entity <entity> failed, can't execute script <this>

Inputs

StartSchedule
Starts the scripted schedule. This will first locate an NPC that matches the given target, then tell the NPC to run the specified schedule.


Outputs