TopicMatchTopicclass | actor.t[2783] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
Handling topic phrases is a bit tricky, because they can't be resolved to definitive game-world objects the way ordinary noun phrases can. Topic phrases can refer to things that aren't physically present, but which are known to the actor performing the command; they can refer to abstract Topic objects, that have no physical existence in the game world at all; and they can ever be arbitrary text that doesn't match any vocabulary defined by the game.
Our strategy in matching topics is to first narrow the list down to the physical and abstract game objects that both match the vocabulary used in the command and are part of the memory of the actor performing the command. That much is handled by the normal topic phrase resolution rules, and gives us a list of possible matches. Then, given this narrowed list of possibilities, we look through the list of objects that we're associated with; we effectively intersect the two lists, and if the result is non-empty, we consider it a match. Finally, we also consider any regular expression that we're associated with; if we have one, and the topic phrase text in the command matches the input, we'll consider it a match.
class
TopicMatchTopic : TopicEntry
TopicMatchTopic
TopicEntry
object
TopicMatchTopic
AskTellTopic
AskAboutForTopic
AskForTopic
AskTellAboutForTopic
AskTopic
TellTopic
ConsultTopic
TopicOrThingMatchTopic
AskTellGiveShowTopic
AskTellShowTopic
Inherited from TopicEntry
:
altTalkCount
altTopicList
impliesGreeting
includeInList
isActive
isConversational
matchObj
matchScore
talkCount
topicGroupActive
topicGroupScoreAdjustment
topicResponse
findMatchObj
isMatchPossible
matchTopic
setTopicPronouns
Inherited from TopicEntry
:
addAltTopic
addSuggestedTopic
addTopic
adjustScore
anyAltIsActive
breakTopicTie
checkIsActive
deferToEntry
getActor
getTopicOwner
handleTopic
initializeTopicEntry
noteAltInvocation
noteInvocation
matchExactCase | actor.t[2800] |
matchPattern | actor.t[2799] |
Note that both the object (or object list) and the regular expression pattern can be included for a single topic entry object. This allows a topic entry to match several different ways of entering the topic name, or to match several different topics with the same response.
findMatchObj (obj, rt) | actor.t[2876] |
isMatchPossible (actor, scopeList) OVERRIDDEN | actor.t[2893] |
matchTopic (fromActor, topic) OVERRIDDEN | actor.t[2814] |
'topic' is a ResolvedTopic object describing the player's text input and the list of objects that the parser matched to the text.
Subclasses can override this as desired to use other ways of matching.
setTopicPronouns (fromActor, topic) OVERRIDDEN | actor.t[2926] |