Condition

From Valve Developer Community
Revision as of 19:26, 3 August 2005 by Fluxtah (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Multiple conditions can be set on an NPC which help the NPC determine what schedule should be run (handled in SelectSchedule() or variants).

An example of a condition is COND_LIGHT_DAMAGE which may cause the NPC to go to an alert state and select a schedule appropriate to this condition.

NPC's can implement their own custom conditions to deal with things unique to that NPC, for instance, you could use a COND_ON_FIRE to determine if the NPC is on fire and select specific schedules on this condition such as SCHED_JUMP_IN_WATER.