TopicEntry class | topicEntry.t[16], facts.t[854]

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[854]:
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 initializeTopicEntry matchTopic qualifiedDesc revealFact scoreBooster topicResponse`

Properties

`active` | `topicEntry.t[172]`

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.

`getActor` | `topicEntry.t[181]`

Our notional actor is our location's actor.

`includeInList` | `topicEntry.t[135]`

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.

`isActive` | `topicEntry.t[160]`

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.

`matchExactCase` | `topicEntry.t[128]`

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

`matchObj` | `topicEntry.t[110]`

The object, topic or list of objects/topics that this TopicEntry matches.

`matchPattern` | `topicEntry.t[122]`

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.

`matchScore` | `topicEntry.t[104]`

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.

`narrator` | `facts.t[961]`

no description available

`scoreBoost` | `topicEntry.t[142]`

A method or property that can be used to dynamically alter our score according to circumstances if needed.

`topicMatched` | `topicEntry.t[115]`

The topic that this TopicEntry actually matched (set by matchTopic()).

Methods

`addTopic (top)` | `topicEntry.t[178]`

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[956]`

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[911]`

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.

`initializeTopicEntry ( )` | `topicEntry.t[76]`

Initialize this Topic Entry (actually carried out at pre-init

`matchTopic (top)` | `topicEntry.t[24], facts.t[963]`

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[946]`

Return a description of the Fact that can be used in this TopicEntry's showResponse() method or eventList property.

`revealFact (tag)` | `facts.t[863]`

We can use revealFact(tag) to both reveal the tag (add it to the list of fact tags that have been revealed and stored in the player character's informedNameTab - what the PC has been informed about) and display the description of the corresponding Fact. We need to use this method if we want the game to keep track of who has imparted particular facts to the Player Character. Game authors will most likely use this method in the topicResponse of AskTopics or QueryTopics.

`scoreBooster ( )` | `topicEntry.t[144]`

no description available

`topicResponse ( )` | `topicEntry.t[87]`

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 25/04/2024 from adv3Lite version 2.0