AltTopicclass | actor.t[2668] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
A set of alternative topics is sort of like an inverted if-then-else. You start by defining a normal TopicEntry (an AskTopic, or an AskTellTopic, or whatever) for the basic response. Then, you add a nested AltTopic located within the base topic; you can add another AltTopic nested within the base topic, and another after that, and so on. When we need to choose one of the topics, we'll choose the last one that indicates it's active. So, the order of appearance is essentially an override order: the first AltTopic overrides its parent TopicEntry, and each subsequent AltTopic overrides its previous AltTopic.
+ AskTellTopic @lighthouse "It's very tall.";
++ AltTopic "Not really..." isActive=(...);
++ AltTopic "Well, maybe..." isActive=(...);
++ AltTopic "One more thing..." isActive=(...);
In this example, the response we'll show for ASK ABOUT LIGHTHOUSE will always be the LAST entry of the group that's active. For example, if all of the responses are active except for the very last one, then we'll show the "Well, maybe" response, because it's the last active response. If the main AskTellTopic is active, but none of the AltTopics are active, we'll show the "It's very tall" main response, because it's the last element of the group that's active.
Note that an AltTopic takes its matching information from its parent, so you don't need to specify a matchObj or any other matching information in an AltTopic. You merely need to provide the response text and the isActive test.
class
AltTopic : TopicEntry
AltTopic
TopicEntry
object
altTalkCount
altTopicOrder
impliesGreeting
includeInList
isConversational
Inherited from TopicEntry
:
altTopicList
isActive
matchObj
matchScore
talkCount
topicGroupActive
topicGroupScoreAdjustment
topicResponse
checkIsActive
initializeAltTopic
isMatchPossible
matchPreParse
matchTopic
noteInvocation
setTopicPronouns
Inherited from TopicEntry
:
addAltTopic
addSuggestedTopic
addTopic
adjustScore
anyAltIsActive
breakTopicTie
deferToEntry
getActor
getTopicOwner
handleTopic
initializeTopicEntry
noteAltInvocation
altTalkCount OVERRIDDEN | actor.t[2756] |
altTopicOrder | actor.t[2742] |
impliesGreeting OVERRIDDEN | actor.t[2730] |
includeInList OVERRIDDEN | actor.t[2685] |
isConversational OVERRIDDEN | actor.t[2733] |
checkIsActive ( ) OVERRIDDEN | actor.t[2700] |
initializeAltTopic ( ) | actor.t[2688] |
isMatchPossible (actor, scopeList) OVERRIDDEN | actor.t[2674] |
matchPreParse (str, pstr) | actor.t[2678] |
matchTopic (fromActor, topic) OVERRIDDEN | actor.t[2670] |
noteInvocation (fromActor) OVERRIDDEN | actor.t[2745] |
setTopicPronouns (fromActor, topic) OVERRIDDEN | actor.t[2681] |