Rule: Difference between revisions
Jump to navigation
Jump to search
Note:Additional "unnamed" criteria can be specified inline in the rule using the same syntax as for defining a criterion, except for the criterion keyword and the criterion name keys.
m (recategorize) |
mNo edit summary |
||
| Line 2: | Line 2: | ||
[[Category:AI Programming]] | [[Category:AI Programming]] | ||
A '''rule''' consists of one or more criteria and a response. The final score for a rule is the sum of all of the scores of its criteria. | |||
<pre>rule <rulename> | <pre>rule <rulename> | ||
Revision as of 18:49, 10 June 2006
A rule consists of one or more criteria and a response. The final score for a rule is the sum of all of the scores of its criteria.
rule <rulename>
{
criteria name1 [name2 name3 etc.]
response responsegroupname [responsegroupname2 etc.]
[matchonce] ; optional parameter
[ <matchkey > <matchvalue> weight nnn required ]
}
- matchonce (off by default): means that the rule is deactivated after the first time it is matched
Here is a example from scripts/talker/npc_alyx.txt.
rule AlyxTalkPlayerPushed
{
criteria IsAlyx ConceptTalkPlayerPushed SeenByPlayer NoRecentCombat
response AlyxTalkPlayerPushed
}