ConvNodeclass | actor.t[1479] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
A ConvNode object must be nested (via the 'location' property) within an actor or an ActorState. This is how we associate the ConvNode with its actor. Note that putting a ConvNode inside an ActorState doesn't do anything different from putting the node directly inside the ActorState's actor - we allow it only for convenience, to allow greater flexibility arranging source code.
class
ConvNode : ActorTopicDatabase
ConvNode
ActorTopicDatabase
TopicDatabase
object
activeSpecialTopic
isSticky
name
npcContinueList
npcContinueMsg
npcGreetingList
patDelim
patWhitespace
Inherited from ActorTopicDatabase
:
askForTopics
askTopics
commandTopics
giveTopics
initiateTopics
miscTopics
showTopics
specialTopics
tellTopics
Inherited from TopicDatabase
:
limitSuggestions
suggestedTopics
topicGroupActive
topicGroupScoreAdjustment
autoShowTopics
canEndConversation
endConversation
getActor
getTopicOwner
handleConversation
noteActive
noteActiveReason
noteLeaving
npcContinueConversation
npcGreetingMsg
npcInitiateConversation
processSpecialCmd
saySpecialTopic
Inherited from ActorTopicDatabase
:
initiateTopic
showTopicResponse
Inherited from TopicDatabase
:
addSuggestedTopic
addTopic
addTopicToList
compareVocabMatch
findTopicResponse
handleTopic
removeSuggestedTopic
removeTopic
removeTopicFromList
showSuggestedTopicList
activeSpecialTopic | actor.t[1842] |
isSticky | actor.t[1509] |
Sticky nodes are useful when you want the actor to stay on-subject even when the player digresses to talk about other things. This is useful when the actor has a particular thread they want to drive the conversation along.
name | actor.t[1495] |
A ConvNode name should be unique with respect to all other ConvNode objects - no two ConvNode objects should have the same name string. Other than this, the name strings are arbitrary. (However, they shouldn't contain any '>' characters, because this would prevent them from being used in <.convnode> tags, which is the main place ConvNode's are usually used.)
npcContinueList | actor.t[1552] |
npcContinueMsg | actor.t[1545] |
npcGreetingList | actor.t[1534] |
patDelim | actor.t[1784] |
patWhitespace | actor.t[1783] |
autoShowTopics ( ) | actor.t[1565] |
By default, we automatically show a topic inventory if the node contains an active SpecialTopic entry. Since special topics are inherently obscure, in that they use non-standard commands, we always want to show topics when one of these becomes active.
canEndConversation (actor, reason) | actor.t[1680] |
To prevent the conversation from ending, simply return nil.
In most cases, you won't want to force the conversation to keep going without any comment. Instead, you'll want to display some message to let the player know what's going on - something like "Hey! We're not through here!" If you do display a message, then rather than returning nil, return the special value blockEndConv - this tells the caller that the actor said something, so the caller will call noteConvAction() to prevent further generated conversation output on this same turn.
'reason' gives the reason the conversation is ending, as an endConvXxx enum code.
endConversation (actor, reason) | actor.t[1697] |
Instances can override this for special behavior on terminating a conversation. For example, an actor who just asked a question could say something to indicate that the other actor is being rude. By default, we do nothing.
Note that there's no way to block the ending of the conversation here. If you want to prevent the conversation from ending, use canEndConversation() instead.
getActor ( ) | actor.t[1634] |
getTopicOwner ( ) OVERRIDDEN | actor.t[1645] |
handleConversation (otherActor, topic, convType, path) | actor.t[1655] |
noteActive ( ) | actor.t[1880] |
Note that if you want to adapt the method's behavior according to why the node was activated, you can override noteActiveReason() instead of this method.
noteActiveReason (reason) | actor.t[1866] |
'reason' is a string giving a reason code for why we're being called. For calls from the library, this will be one of these codes:
'convnode' - processing a <.convnode> tag
'convend' - processing a <.convend> tag
'initiateConversation' - a call to Actor.initiateConversation()
'endConversation' - a call to Actor.endConversation()
The reason code is provided so that the node can adapt its action for different trigger conditions, if desired. By default, we ignore the reason code and just call the basic noteActive() method.
noteLeaving ( ) | actor.t[1892] |
npcContinueConversation ( ) | actor.t[1597] |
npcGreetingMsg ( ) | actor.t[1526] |
A greeting should always be defined for any ConvNode that's used in an initiateConversation() call.
To define a greeting when defining a ConvNode, you can override this method with a simple double-quoted string message, or you can define an npcGreetingList property as an EventList of some kind.
npcInitiateConversation ( ) | actor.t[1573] |
processSpecialCmd (str, procStr) | actor.t[1717] |
'str' is the original input string, exactly as entered by the player, and 'procStr' is the "processed" version of the input string. The nature of the processing varies by language, but generally this involves things like removing punctuation marks and any "noise words" that don't usually change the meaning of the input, at least for the purposes of matching a special topic.
saySpecialTopic (fromActor) | actor.t[1801] |