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().
Modified in facts.t[976]:
Modifications to ActorTopicEntry to work with Facts.
class
ActorTopicEntry : ReplaceRedirector TopicEntry
Superclass Tree (in declaration order)
ActorTopicEntry
ReplaceRedirector
Redirector
object
TopicEntry
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
activateKeyTopics
active
agenda
agendaPath
arouseKeyTopics
aTag
autoName
autoSuppress
autoSuppressSubTopics
autoUseAgenda
convKeys
curiosityAroused
getActor
impliesGreeting
keyTopics
lastConvResponse
lcrScriptClass
listOrder
name
nextStep
suggestAs
timesInvoked
tTag
wasConversational
Inherited from TopicEntry
:
includeInList
isActive
matchExactCase
matchObj
matchPattern
matchScore
narrator
scoreBoost
topicMatched
Summary of Methods
activate
addToConvKeyTable
baseHandleTopic
buildName
curiositySatisfied
deactivate
filterTopicSuggestions
fText
getKeyTopics
handleTopic
infTag
initializeTopicEntry
isConversational
isReachable
nodeActive
qualifiedDesc
revTag
showKeyTopics
timesToSuggest
tryAgenda
tryNextStep
useAgenda
Inherited from ReplaceRedirector
:
redirect
Inherited from Redirector
:
doInstead
doNested
doOtherAction
Inherited from TopicEntry
:
addTopic
factText
informFact
matchTopic
revealFact
scoreBooster
topicResponse
Properties
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.
Flag, do we want a master topic to automatically update all its associated subtopics (associated via its keyTopics property). By default we don't (for now).
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.
If we like, we can specify a particuler FactAgendaItem to use in conjunction with this ActorTopicEntry. But note that if autoUseAgenda is true the AgendaItem we specify here will be ignored unless useAgenda() can't find a suitable AgendaItem.
The path out associated FactAgendaItem wants to take. This will be a list of fact name tags.
Flag, do we want a master topic to automatically update all its associated subtopics (associated via its keyTopics property). By default we do, or else they won't be included in any list of suggestions at this point.
The knowledge tag associated with this ActorTopicEntry. If it's nil, we ignore it. This is the tag for a fact our actor is being told about in response to something we'vr asked.
Set autoName to true to have this topic entry generate a name from its
Flag:do we want to suppress suggesting this topic if subtopics it has suggested through its keyTopic property are in the current list of suggested topics. By default we do but this can be overridden to nil if it produces unwanted behaviour.
Flag - the complement to autoSuppress. If this is true then when the player changes the main topic when a list of suggestions of subtopics from another main topic (e.g. by typing ASK ABOUT WEATHER after a previous ASK ABOUT ISLAND has called up a suggested list of subtopics about the island), then we'll suppress the list of subtopics (on the basis that the player appears to be no longer interested in them, at least for the time being.
Do we want the ActorTopicEntry to find an appropriate FactAgendaItem for us? By default we don't. This should only be set to true on ActorTopicEntries that are going to make use of FactAgendaItem path information.
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.
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.
Our associated actor is our location's associated actor.
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.
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.
Our last conversational response if we're a StopEventList. This can be set as a negative numner, such as -1 to mean the last but one. This may be useful if our final response is a summary of what the NPC has said rather than a conversational response which s/he speaks, so that we don't want to suggest the final response or treat it as conversational.
The script class we want lastConvResponse to be applicable. By default this is StopEventList, which is what it is designed to be used with, but this allows game code to adjust this. It also allows gameCode to override lastConvResponse on ActorTopicEntry and have it only apply to ActorTopicEntries that are also of lcrScriptClass.
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.
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.
The next step (next fact) our associated FactAgendaItem would like us to use. We can use this to tailor our topicResponse as we see fit, which could include responding with our nextStep's description, or could be something more subtle.
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.
The number of times this topic entry has been invoked.
The fact tag we're going to inform and reference if we are telling (imparting information to the other actor we're talking to.
Was this ActorTopicEntry just before we display our Topic Response, which could change the value of isConversational by advancing curScriptState.
Methods
Activate this TopicEntry. This would normally be called in game code via an <.activate> tag.
Add this ActorTopicEntry to its associated actor's table of convKeys
Handle the display of this topic entry's topicResponse or of its suggested subtopics as appopriate.
Modified in factrel.t[605]:
If we found a suitable FactAgendaItem, return it, otherwise return the AgendaItems specified on our agenda property.
Construct the name of this ActorTopicEntry by using the theName property of our first matchObj.
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 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.
Filter the list of topics to be suggested by removing from the list any subtopics relating to a new main topic (e.g. when the player types A WEATHER when the list of subtopic relating to A ISLAND is still available. The subtopics are removed simply by having their curiosityAroused reset to nil, indicating that the player's curiosity has moved on elsewhere. at least for the time being.
Short-nae method of retrieving the description of the fact associated with aTag or tTag without carrying out any further side-effects.
Obtain a list of the TopicEntries that match our keyTopics property.
Handle this topic (if we're the ActorTopicEntry selected to respond to a conversational command.
Initialize this ActorTopicEntry (this is actually called at preinit)
Modified in facts.t[989]:
Carry out additional initialization to set our matchObj from our aTag
Should we be treated as conversational? Normally an ActorTopicEntry should (except for certain subtypes) but if we're also a script and our lastConvResponse has been defined as non-nil we may want to do something different.
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.
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.
qualifiedDesc (actor, tag, topicMatched) OVERRIDDEN | facts.t[1033] |
Get the relevant qualified fact description
Short-name method for retrieving the description of the fact associated with aTag and updating what the player character knows and the fact's list of sources.
Show our suggested keyTopics, if keyTopics is defined.
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. If, on the other hand, you want it to be suggested fewer times than there are items in the EventList, say because the final item in a StopEventList is a summary of what was said before rather than a conversational response from the NPC, override the lastConvResponse accordingly (most likely to -1).
Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0