TopicEntryclasstopicEntry.t[16], facts.t[1030]

TopicEntry is the base class for ConsultTopics and various kinds of Conversation Topics. It can be used to match a particular topic and output an appropriate response.

Modified in facts.t[1030]:
Modifications to Topic Entry to work with Facts

class TopicEntry :   object

Superclass Tree   (in declaration order)

TopicEntry
        object

Subclass Tree  

TopicEntry
        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
        ConsultTopic
                DefaultConsultTopic
                FactConsultTopic
        Thought
                DefaultThought
                FactThought

Global Objects  

(none)

Summary of Properties  

active  getActor  includeInList  isActive  matchExactCase  matchObj  matchPattern  matchScore  narrator  scoreBoost  topicMatched 

Summary of Methods  

addTopic  factText  informFact  informNewFact  initializeTopicEntry  interpret  matchTopic  qualifiedDesc  revealFact  revealNewFact  scoreBooster  topicResponse 

Properties  

activetopicEntry.t[171]

The active property is used internally by the library to determine whether a TopicEntry is currently available for use. On the base TopicEntry class a topic entry is active if its isActive property is true, but this is not necessarily the case on the ActorTopicEntry subclass defined in actor.t, which needs to distinguish between these properties.

Game code should not normally need to override the active property.

getActortopicEntry.t[180]
Our notional actor is our location's actor.

includeInListtopicEntry.t[134]
The set of database lists we're part of. This is a list of one or more property pointers, giving the TopicDatabase properties of the lists we participate in.

isActivetopicEntry.t[159]
Is this TopicEntry currently active? Game code can set a condition here so that a TopicEntry only becomes active (i.e. available) under particular circumstances.

matchExactCasetopicEntry.t[127]
Do we want to restrict this TopicEntry to an exact case match with its matchPattern? By default we don't.

matchObjtopicEntry.t[109]
The object, topic or list of objects/topics that this TopicEntry matches.

matchPatterntopicEntry.t[121]
A regular expression that this TopicEntry might match, if it doesn't match a matchObj. We don't need to define this if we've defined a matchObj.

matchScoretopicEntry.t[103]
Our matchScore is the base score we return if we match the topic requested; this is used to determine whether we're the best match under the circumstances. By default we use a value of 100.

narratorfacts.t[1183]
Our narrator is the person (or Consultable) imparting a fact vis this TopicEntry. This is set by either our revealFact() or our informFact() method.

scoreBoosttopicEntry.t[141]
A method or property that can be used to dynamically alter our score according to circumstances if needed.

topicMatchedtopicEntry.t[114]
The topic that this TopicEntry actually matched (set by matchTopic()).

Methods  

addTopic (top)topicEntry.t[177]

If something located in us wants us to add it to our topic database, pass the request up to our location (this is used by AltTopic).

factText (tag, actor, =, getActor)facts.t[1174]
Simply display the descrption of the Fact corresponding to tag without changing the game state. This might conceivably be of use, for example, in a Thought.

informFact (tag, actor, =, getActor, ()facts.t[1105]
We can use informFact to update our current interlocutor's InformedTab list (removing th need to use a separate <.inform> tag to do so), to update the fact's target list (i.e. the list of people who have been informed of the fact by the current player character), and to return a description of the fact that can be embedded in the topicResponse of a TellTopic, or SayTopic. The actor parameter, if specified, should be the actor being informed, which will usually be the current interlocutor in a conversational context.

The optionsl msg parameter works the same way as for revealFact. The optional actor parameter defines the actor who is being informed of this fact, and defaults to getActor, who will usually be the conversational partner here. The actor parameter can be omitted and the msg parameter placed second and will still be interpreted correctly via its dataType.

informNewFact (name_, desc_, msg?, topics_?, initiallyKnownBy_?, actor?)facts.t[1261]
Inform actor of a Fact that hasn't been (or may not have been) created yet. If it doesn't exist, we create it and then call informFact() to reveal and display it. name_ is the new fact tag name; desc_ is the fact's description; msg is the optional msg parameter for displaying the fact description in the context of this TopicEntry; topics? is the list of topics this new facts relates to - we default to this TopicEmtry's matchObj; initiallyKnownBy is the actor or list of actor's this Fact starts out already known by - we default to gPlayerChar, the person most likely to be informing the current interlocutor of the new fact at this point.

initializeTopicEntry ( )topicEntry.t[75]
Initialize this Topic Entry (actually carried out at pre-init

interpret (fact, msg)facts.t[1194]
Translate the msg parameter into a single-quoted string appropriate to fact

matchTopic (top)topicEntry.t[24], facts.t[1185]
Determine how well this TopicEntry matches top (a Topic or Thing). If it doesn't match at all we return nil, otherwise we return a numerical score indicating the strength of the match so that a routine that's looking for the best match can choose the one with the highest score.

qualifiedDesc (actor, tag, topic, sender)facts.t[1164]
Retrieve and return the qualified description of the Fact corresponding to Fact qualified according to actor, topic and sender (which will normally be self, this TopicEntry, here).

revealFact (tag, msg?)facts.t[1040]
Reveal the fact corresponding to tag and return its description. The optional msg parameter can customoize the way the description is displayed, and can be a single-quoted string (to be used as a description of the fact) an integer (indexing the fact's factDescs list, a property pointer, in which case the corresponding method will be called on the fact with self as an argument, or a function pointer, in which case the function will be executed with self as an argument. The method or function called should return a single-quoted string to be used to describe the fact.

revealNewFact (name_, desc_, msg?, topics_?, initiallyKnownBy_?)facts.t[1237]
Reveal a Fact that hasn't been (or may not have been) created yet. If it doesn't exist, we create it and then call revealFact() to reveal and display it. name_ is the new fact tag name; desc_ is the fact's description; msg is the optional msg parameter for displaying the fact description in the context of this TopicEntry; topics? is the list of topics this new facts relates to - we default to this TopicEmtry's matchObj; initiallyKnownBy is the actor or list of actor's this Fact starts out already known by - we default to getActor, the conversation partner the player character is talking to at this point.

scoreBooster ( )topicEntry.t[143]
no description available

topicResponse ( )topicEntry.t[86]
Output our response to the topic. This can be typically be overridden to a double-quoted string or method to output the required response.

Adv3Lite Library Reference Manual
Generated on 03/07/2024 from adv3Lite version 2.1