Response System: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:




==Add your new custum NPC to the Response System==
==Add your new custom NPC to the Response System==
*Make your NPC derived from NPC_talker
*Make your NPC derived from NPC_talker
*Write a new rule script for your NPC
*Write a new rule script for your NPC

Revision as of 16:45, 8 August 2005

Stub

This article or section is a stub. You can help by expanding it.

Introduction

In HL2, AIs speak based on Concepts.


/scripts/talker/response_rules.txt is the base script file for this Response System. It contains criterion/rule/response definitions. This controls interactive NPC talks in game. e.g. It makes Alyx say "Excuse me," Citizens greet, Vortigaunts tell stories, etc.


The Response system checks each rule against the set, give it a numeric score based on the rule's set of criteria. Then the system picks one rule with the highest score, dispatch a response that the rule points.


Add your new custom NPC to the Response System

  • Make your NPC derived from NPC_talker
  • Write a new rule script for your NPC
    • See npc_xxx.txt for examples
  • Include the new script in /scripts/talker/response_rules.txt