ActorTopicEntryclass
An ActorTopicEntry is a specialization of TopicEntry for use with the conversation system. ActorTopicEntries represent potential responses to conversational commands like ASK BOB ABOUT LIGHTHOUSE or TELL GEORGE ABOUT FIRE.
Since ActorTopicEntry inherits from ReplaceRedirector as well as TopicEntry, its topicResponse() methods can make use of doInstead() and doNested().
class
ActorTopicEntry
:
ReplaceRedirector
TopicEntry
Superclass Tree (in declaration order)
ActorTopicEntry
ReplaceRedirector
Redirector
` object
[
TopicEntry](../object/TopicEntry.html)
object`
Subclass Tree
ActorTopicEntry
AltTopic
AskAboutForTopic
AskForTopic
AskTellGiveShowTopic
AskTellShowTopic
AskTellTopic
AskTopic
CommandTopic
DefaultTopic
DefaultAnyTopic
DefaultAgendaTopic
DefaultAnyNonSayTopic
DefaultAskForTopic
DefaultAskQueryTopic
DefaultAskTellTopic
DefaultAskTopic
DefaultCommandTopic
DefaultConversationTopic
DefaultNonSayTopic
DefaultGiveShowTopic
DefaultGiveTopic
DefaultQueryTopic
DefaultSayQueryTopic
DefaultSayTellTalkTopic
DefaultSayTellTopic
DefaultSayTopic
DefaultShowTopic
DefaultTalkTopic
DefaultTellTalkTopic
DefaultTellTopic
GiveShowTopic
GiveTopic
InitiateTopic
NodeContinuationTopic
NodeEndCheck
MiscTopic
GreetingTopic
ActorByeTopic
BoredByeTopic
ByeTopic
HelloGoodbyeTopic
HelloTopic
ActorHelloTopic
ImpHelloTopic
ImpByeTopic
LeaveByeTopic
HitTopic
KissTopic
NoTopic
TouchTopic
YesNoTopic
YesTopic
SceneTopic
SceneEndTopic
SceneStartTopic
ShowTopic
SlaveTopic
SpecialTopic
QueryTopic
SayTopic
TalkTopic
AskTalkTopic
AskTellTalkTopic
TellTalkTopic
TellTalkShowTopic
TellTopic
Global Objects
(none)
Summary of Properties
activated
active
autoName
convKeys
curiosityAroused
getActor
impliesGreeting
isConversational
keyTopics
listOrder
name
suggestAs
timesInvoked
Inherited from TopicEntry
:
includeInList
isActive
matchExactCase
matchObj
matchPattern
matchScore
scoreBoost
topicMatched
Summary of Methods
activate
addToConvKeyTable
buildName
curiositySatisfied
deactivate
getKeyTopics
handleTopic
initializeTopicEntry
isReachable
nodeActive
showKeyTopics
timesToSuggest
Inherited from ReplaceRedirector
:
redirect
Inherited from Redirector
:
doInstead
doNested
doOtherAction
Inherited from TopicEntry
:
addTopic
matchTopic
scoreBooster
topicResponse
Properties
activated
A flag that can be set with an <.activate> tag. It must be true for this TopicEntry to be active, regardless of the value of isActive. It starts out true by default, but it can be set to nil on TopicEntries that you want to start out as inactive subsequently activate via an activate tag.
active
OVERRIDDEN
This TopicEntry is active if its own isActive property is true and its activated property is true and if its location is active. This allows the isActive conditions of individual TopicEntries to be combined with that of any TopicGroups they’re in. This property should not normally be overridden in game code.
autoName
Set autoName to true to have this topic entry generate a name from its
convKeys
A string or list of strings defining one or more groups to which this topic entry belongs. Under certain circumstances an ActorTopicEntry may be prioritized if its convKeys overlaps with the associated actor’s activeKeys.
curiosityAroused
We won’t suggest this topic entry (if we ever suggest it at all) until its curiosityAroused property by true. By default it normally is from the start, but this can be overridden in individual cases if desired.
getActor
Our associated actor is our location’s associated actor.
impliesGreeting
Normally a conversational command implies a greeting (that is, it should trigger a greeting if a conversation is not already in process). This needs to be overridden to nil on ActorTopicEntries that explicitly handle greetings (HelloTopic and its subclasses) to avoid an infinite loop.
isConversational
An ActorTopicEntry is conversational (the default) if it results in an actual conversational exchange. Change this to nil for ActorTopicEntries that merely report why a conversational exchange did not take place (e.g. “Bob ignores you” or “You think better of talking to George about that.”)
keyTopics
The keyTopics can contain a convKey or a list of convKeys, in which case when this TopicEntry is triggered instead of responding directly it will list topic suggestions that correspond to the convKeys defined here. For example, a TopicEntry that responded to ASK BOB ABOUT TROUBLES could define a keyTopics property of ‘troubles’ that triggered more specific suggestions such as “You could ask when the troubles started, or what the troubles were, or how the troubles ended”, assuming that these QueryTopics had a convKeys property of ‘troubles’
If you want this TopicEntry to display its topicResponse in the normal way, leave keyTopics as nil.
listOrder
The order this TopicEntry appears in within its group in a list of suggested topics. The higher this number, the later this topic will be suggested. Note that this does not override the grouping of suggestions into AskTopics, TellTopics, etc.
name
To make this a suggested topic, just give it a name under which it will be suggested (of the kind that could follow ‘You could ask about ‘ or ‘You could tell him about ‘ or ‘You could show him ‘ etc.). Note that for QueryTopics and SayTopics that are specified with a matchObj the library constructs this name automatically.
suggestAs
The suggestAs property can be overridden to change the list this topic entry will be suggested as if you don’t want it placed in the list the library chooses by default. The allowed values are one of AskTopic, TellTopic, GiveTopic, ShowTopic, or TalkTopic. Normally, though, the library default will work perfectly well and you don’t need to specify this property. If you do it must be specified as a kind that this topic entry can actually match, e.g. TellTopic for an AskTellTopic or ShowTopic for a GiveShowTopic.
timesInvoked
The number of times this topic entry has been invoked.
Methods
activate ( )
Activate this TopicEntry. This would normally be called in game code via an <.activate> tag.
addToConvKeyTable ( )
Add this ActorTopicEntry to its associated actor’s table of convKeys
buildName ( )
Construct the name of this ActorTopicEntry by using the theName property of our first matchObj.
curiositySatisfied ( )
Assuming this topic entry is ever suggested, it will continue to be suggested until curiositySatisfied becomes true. By default this occurs when the topic has been invoked timesToSuggest times. If, however, we have any keyTopics we’ll take our curiosity to be satisfied when our keyTopics have all been satisfied.
deactivate ( )
Deactivate this topic. This could typically be used from within the topicResponse of an ActorTopicEntry you only want to use once (or in the last entry in a StopEventList of an ActorTopicEntry). It can also be called via a <.deactivate key> tag in combination with the convKeys.
getKeyTopics (updateStatus)
Obtain a list of the TopicEntries that match our keyTopics property.
handleTopic ( )
Handle this topic (if we’re the ActorTopicEntry selected to respond to a conversational command.
initializeTopicEntry ( )
OVERRIDDEN
Initialize this ActorTopicEntry (this is actually called at preinit)
isReachable ( )
Determine whether this TopicEntry is currently reachable, i.e. whether it could be reached if the player asked/told etc. about its matchObj on the next turn.
nodeActive ( )
Test whether any of this Topic Entry’s convKeys match those in the Actor’s activeKeys list (whether or not the latter has any entries). This can be used in the isActive property to make this topic entry *only* available when its convKeys are active.
showKeyTopics ( )
Show our suggested keyTopics, if keyTopics is defined.
timesToSuggest ( )
The number of times to suggest this topic entry, if we do suggest it. By default this is either once (if we’re not also an EventList) or the number of items in our eventList (if we are an EventList). If you want this topic entry to go on being suggested ad infinitum, set timesToSuggest to nil.
Adv3Lite Library Reference Manual
Generated on 15/03/2023 from adv3Lite version 1.6.1