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
factIntro
knewFactAlreadyMsg
listSources
matchObj
noFactsMsg
noteContradictions
prefix
suffix
tagList
updateSources
Summary of Methods
alreadyKnewMsg
getFacts
topicResponse
Properties
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).
The word or phrase used to introduce the description of a fact or list of facts. In English this is simply 'that'.
The parenthetical message to append to a listed fact if the player character has been informed of something they already knew.
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.
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.
The message to display if we don't find any matching facts. Subclasses will override as appropriate.
Do we actually want to note (i.e. report on) the presence of contradictions here? By default we do but game code can override.
The prefix to be used to a list of facts. We specify nothing here since subclasses will override as approprite.
The suffix to appear at the end of our list or item; normally this will be a full stop followed by a space.
A list of the tags (Fact tag names) we're currently interested in. Note that this is populated by a call to getFacts().
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
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.
Get a sorted list of the facts known to our actor that are associated with the topic matched by our TopicEntry.
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 25/04/2024 from adv3Lite version 2.0