FactHelper class | facts.t[605], factrel.t[486]

Mix-in class for use with IopicEntries (typically Thoughts or ConsultTopics, though game authors are free to experiment with mixing it in with ActorTopicEntries, probably most usefully AskTopics or DefaultAskTopics), to provide additional functionality relating to Facts, in particular to generate a suitably formatted list of facts relating to the topic the TopicEntry has just matched, thereby automating the response to commands like THINK ABOUT X or LOOK UP X IN BOOK.

Modified in factrel.t[486]:
Modification in the FACT RELATIONS Extension to allow contradictions between listed Facts to be noted. We may no attempt to say precisely where any contradictions occur, since that seems best left to the player to spot.

`class FactHelper : object`

Superclass Tree (in declaration order)

`FactHelper`
`object`

Subclass Tree

`FactHelper`
`FactConsultTopic`
`FactThought`

Global Objects

(none)

Summary of Properties

`addLineBreaks autoInform autoReveal factIntro knewFactAlreadyMsg listSources matchObj noFactsMsg noteContradictions prefix suffix tagList updateSources`

Summary of Methods

`alreadyKnewMsg doubtFactMsg getFacts topicResponse`

Properties

`addLineBreaks` | `facts.t[891]`

Do we want to insert line breaks between each item in a list of fact descriptions (so that we get a vertical list of facts or list them all in a continous sentence (addLineBreas = nil, the default).

`autoInform` | `facts.t[905]`

Flag, do we want to inform all the tags we encounter in our topicResponse. It makes sense to do so on a FactConsultTopic but not on a FactThought, which shouldn't change the game state.

`autoReveal` | `facts.t[898]`

Flag, do we want to reveal all the tags we encounter in our topicResponse. It makes sense to do so on a FactConsultTopic but not on a FactThought, which shouldn't change the game state.

`factIntro` | `facts.t[736]`

The word or phrase used to introduce the description of a fact or list of facts. In English this is simply 'that'.

`knewFactAlreadyMsg` | `facts.t[692]`

The parenthetical message to append to a listed fact if the player character has been informed of something they already knew.

`listSources` | `facts.t[884]`

Do we want to list the sources of the facts our topicResponse is reporting? We might well want to do so on a ConsultTopic but probably not on a Thought, so we default to nil here.

`matchObj` | `facts.t[869]`

Since we're typically going to be used to make a catch-all TopicEntry, we'll normally want to match any Thing or Topic in the game.

`noFactsMsg` | `facts.t[686]`

The message to display if we don't find any matching facts. Subclasses will override as appropriate.

`noteContradictions` | `factrel.t[538]`

Do we actually want to note (i.e. report on) the presence of contradictions here? By default we do but game code can override.

`prefix` | `facts.t[674]`

The prefix to be used to a list of facts. We specify nothing here since subclasses will override as approprite.

`suffix` | `facts.t[680]`

The suffix to appear at the end of our list or item; normally this will be a full stop followed by a space.

`tagList` | `facts.t[668]`

A list of the tags (Fact tag names) we're currently interested in. Note that this is populated by a call to getFacts().

`updateSources` | `facts.t[878]`

Do we want our topicResponse() method to update the list of sources on the Facts it lists? We probably if we're mixed in with a ConsultTopic (to note the corresponding Consultable as the source of information) but not if we're mixed in with a Thought (since the Player Character must already effecitvely be a potential source of the information they're recalling).

Methods

`alreadyKnewMsg (fact)` | `facts.t[700]`

Return a message stating that a fact was already known if the player character started out knowing it from the beginning of the game or an empty string otherwise. This makes it safe to call this method without knowing whether it's applicable, since this method will determine the applicabilitly.

`doubtFactMsg (beliefVal)` | `facts.t[726]`

Otherwise simply return an empty string.

`getFacts ( )` | `facts.t[610]`

Get a sorted list of the facts known to our actor that are associated with the topic matched by our TopicEntry.

`topicResponse ( )` | `facts.t[745], factrel.t[491]`

The topicResponse to be provided by the TopicEntry we're mixed-in with. This performs the main purpose of the FactHelper mix-in class by providing an automated suitably-formatted list of the facts (and possibly their sources) associated with the topic matched by our TopicEntry. This can be used to automate the response to THINK ABOUT X or LOOK UP X IN WHATEVER, provided Facts have been used elsewhere to provide previous responses.

Modified in factrel.t[491]:
Add a message noting contradictions (as defined by the contradicting Relation) between any two facts just listed in our response.

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1