ppf2f969ee.png
pp745d1a75.png
Eric Eve 16-Mar-07 Page 1
(although you can also include HelloTopic and ByeTopic on other ActorStates to handle these commands.)
·
CommandTopic - provide a response to a command issued to the actor, e.g. “Bob, read the book” would activate CommandTopic @ReadAction.
·
InitiateTopic responds to Actor.initiateTopic(obj)

TopicEntry Methods & Properties
·
matchObj - My matching simulation object or objects.  This can be either a single object or a list of objects.
·
getActor() - The Actor object to whom this topic ultimately belongs
·
isActive - the condition that determines when the topic entry should  become active.  We'll never show the topic's response when isActive returns nil. Allows conditional responsibilities, especially in conjunction with AltTopic and TopicGroups.
·
isConversational - true by default, if nil does not trigger greeting protocols.
·
matchScore - the match strength score.  By default, we'll use a score of 100,  which is just an arbitrary base score.
·
topicResponse  - Our response.  This is displayed when we're the topic entry selected to handle an ASK or TELL.  Each topic entry must overridethis to show our response text (or, alternatively, an entry can override handleTopic(fromActor, topic) so that it doesn't call this property)
·
matchPattern - match a regular expression pattern (as an alternative to matchObj).

TopicEntry Templates
·
TopicEntry template +matchScore?  @matchObj | [matchObj] | 'matchPattern' "topicResponse" | [eventList] ?;
·
TopicEntry template  +matchScore?  @matchObj | [matchObj] | 'matchPattern' [firstEvents] [eventList];
·
TopicEntry template +matchScore? @matchObj | [matchObj] 'matchPattern' "topicResponse" | [eventList] ?;
·
TopicEntry template  +matchScore?  @matchObj | [matchObj] 'matchPattern' [firstEvents] [eventList];

·
MiscTopic template "topicResponse" | [eventList];
·
MiscTopic template [firstEvents] [eventList];


DefaultTopics
·
DefaultAskTopic, DefaultTellTopic, DefaultAskTellTopic,  DefaultGiveTopic, DefaultShowTopic, DefaultGiveShowTopic, DefaultAskForTopic, DefaultInitiateTopic, DefaultCommandTopic, DefaultAnyTopic

AltTopic
·
isActive - the condition that must be true for this topic to be used instead of the TopicEntry within which it is directly nested.

TopicGroup (nest inside the appropriate ActorState; nest related TopicEntry or TopicGroup objects within the TopicGroup)
·
isActive  - the condition that allows this topic group to be active.

TopicInventory
There are three ways the topic inventory can be displayed:
·
in response to a TOPICS command from the player;
·
in response to a TALK TO command from the player;
·
any other time the game (or library) thinks it's a good idea.
SuggestedTopic Subclasses:
·
SuggestedAskTopic, SuggestedTellTopic, SuggestedShowTopic, SuggestedGiveTopic, SuggestedYesTopic, SuggestedAskForTopic and SuggestedNoTopic.
Properties
·
name - this is the name that will be shown in the suggested topic list. It should be given so that it can be substituted into a sentence after "ask about" (or the appropriate variation for the other types), so it should usually include "the" if appropriate.

ConvNode (Nest directly inside Actor; nest topic entries in ConvNode)
·
+ ConvNode 'name'
·
npcGreetingMsg - use this to display a message when the NPC initiates a conversation, generally via a call to Actor.initiateConversation(ActorState, ‘name’).
·
npcGreetingList - use as an alternative to npcGreetingMsg in cases where the ConvNode may be initiated more than once.
·
npcContinueMsg or npcContinueList - the InConversationState class automatically displays the current ConvNode's continuation message (using either npcContinueMsg or npcContinueList, as appropriate) on each turn on which the ConvNode is active, and the player didn't address a conversational command to the NPC on the same turn.
·
endConversation(actor, reason) -  Instances can override this for special behaviour on terminating a conversation.
·
canEndConversation(actor, reason) - lets a node prevent a conversation ending, by returning nil or  blockEndConv; reason can be endConvBye, endConvTravel, or endConvBoredom.
·
isSticky - if this flag is true (it’s nil by default) then this conversation node remains current until a response explicitly changes the node.

SpecialTopic (only for use in ConvNode)
·
example: ++ SpecialTopic 'call him a liar' ['call', 'bob', 'him', 'a', 'liar']
    "<q>You're so full of crap, Bob [...] " ;

Tags (for use in TopicEntry & SpecialTopic object text response output)
·
<.convode name> - switches the NPC that issued the response to the named conversation node. You can also set the tree position explicitly by calling the NPC's setConvNode(name) method, passing the new conversation node name as the parameter.
·
<.convstay> - - keep the responding actor in the same conversation node as it was in at the start of the current response
·
<.topics> -schedule a topic inventory for the end of the turn.
·
<.reveal key> - add 'key' to the knowledge token lookup table.  The 'key' is an arbitrary string, which we can look up in the table to  determine if the key has even been