Behaviors let you abstract AI code to a C++ class of its own which is not tied to any one NPC. You might want to create MensBathroomBehavior for male NPCs and WomensBathroomBehavior for female NPCs, for instance.

Contents

Authoring a behavior

Behavior code, for the most part, behaves in the same way and uses the same framework as AI code you would write directly into an NPC. There is a certain amount of 'glue' required between one and the NPCs that will use it however:

The behavior

Create bool CanSelectSchedule(), which defines whether or not an NPC will 'defer' to the behavior for a given think.