This article's documentation is for anything that uses the Source engine. Click here for more information.

aiscripted_schedule

From Valve Developer Community
Jump to navigation Jump to search
English (en)Hrvatski (hr)Translate (Translate)
Class hierarchy
CAI_ScriptedSchedule
CBaseEntity
scripted.cpp
Aiscripted schedule.png

aiscripted_schedule is a point entity available in all Source Source games except Left 4 Dead series Left 4 Dead series.

It issues a command to an NPC without suppressing its normal AI routines.

This entity is often used to make a NPC travel to a specific location or follow a path_corner track.

PlacementTip.gifPlacement Tip:A NPC can follow a tight path_corner track without requiring a nodegraph, but this is not recommended since a nodegraph is still needed for NPCs to navigate around corners or move freely.

Flags

Repeatable : [4]
Search Cyclically : [1024]

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 : [2048]

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>

Keyvalues

Name (targetname) <string>
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

Target NPC (m_iszEntity) <targetname>
The name or classname of an NPC to command.
Search Radius (0=everywhere) (m_flRadius) <float>
Radius to search within for an NPC to command.
All in radius (graball) <boolean>
Whether to grab all matching NPCs in the specified radius, or just the first one found.
AI state to set (forcestate) <choices>
Overrides the NPC's current alertness state.
  • 0: <None>
  • 1: Idle
  • 2: Alert
  • 3: Combat
Schedule to run (schedule) <choices>
Which AI schedule to run.
  • 0: <None>
  • 1: Walk to Goal Entity (see below)
  • 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 (interruptability) <choices>
What can cause the NPC to give up on this schedule?
  • 0: General
  • 1: Damage or Death
  • 2: Death
Goal entity (goalent) <targetname>
Provides the name of a goal entity, used by some schedules.
PlacementTip.gifPlacement Tip:You can use the schedule entity itself as the goal entity.

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.
StopSchedule  !FGD
Tells NPC targets to stop running this schedule.

See also