Factclassfacts.t[21]

A Fact encapsulates an item of knowledge (or supposed knowledge) keyed on the fact tags in the appropriate object's informedNameTab. Note that for the purposes of thid module, a Fact is not something that is necessarily true, but simply somethhing that some actor or Consultable in the game has asserted to be true.

class Fact :   object

Superclass Tree   (in declaration order)

Fact
        object

Subclass Tree  

(none)

Global Objects  

(none)

Summary of Properties  

adjustedPriority  defaultTruthValue  desc  initiallyKnownBy  listOrder  name  pcComment  pcCommentTab  priority  sourcepat  sourcesListed  sourcesTab  targetsTab  topics 

Summary of Methods  

addSource  addTarget  currentlyKnownBy  getPcComment  getSources  getTargets  initializeFact  qualifiedDesc  setPcComment  sourceIntro 

Properties  

adjustedPriorityfacts.t[352]

Deduct our listOrder from our priority to get the adjustedPriority that will actualy be used to sort facts in the desired order. This allows game authors to use either property (or possibly a combination of both) to determine the listing order.

defaultTruthValuefacts.t[92]
The truth value that most characters in this game are likely to assign to this fact. The other possible values defined in the library are likely, dubious, unlikely and untrue. Game authors are free to invent other values if they wish.

descfacts.t[29]
Our descripition. This should a single-quoted string with no closing punctuation that could follow 'that'; for example 'Spain is a country in Europe' or 'it rained yesterday'

initiallyKnownByfacts.t[85]
The list of actors and other objects - typically Consultables - that start the game knowing about us. If any actors in the list should start out dissenting from the defaultTruthValue for this fact then this can be set by using two item list of the form [actor, value] in place of just the actor, e.g. you could have [me, bob, susan, [thomas, dubious]].

listOrderfacts.t[345]
Alternatively we can use our list order to determine the order in which facts will be listed. By default we use give everything a list order of 1.

namefacts.t[23]
Our name is the fact tag (used in gInformed() stateement or the like) that identifies us.

pcCommentfacts.t[290]
A single-quoted string containing the initial player character's initial comment or thought on this Fact; this can be left at nil if the PC doesn't have one. This will be appended to the description of this Fact when listed by a Thought, so should be a sentence fragment starting with a lower case letter (or some form of parenthetic punctuation) and without a full stop at the end.

pcCommentTabfacts.t[297]
A table containing platey characters' comments on this Fact. We use a LookpTable here in case the player character changes, so we can retrieve the comment relevant to the current player character

priorityfacts.t[339]
Our priority (what is our relevant importance). Facts with a higher priority will be listed earlier in any list of facts. We set a defaul priority of 100.

sourcepatfacts.t[73]
Our RexPattern for searching for a string of characters between square brackets, e.g. [bob]

sourcesListedfacts.t[280]
Return the string that results.

sourcesTabfacts.t[150]
LookUpTable containing lists of which sources have imparted this Fact to which actor; actor defaults to gPlayerChar we use a LookUpTable here in case the player character changes during the courss of play.

targetsTabfacts.t[157]
LookUpTable containing lists of whom actor has imparted this Fact; actor defaults to gPlayerChar we use a LookUpTable here in case the player character changes during the courss of play.

topicsfacts.t[77]
The list of topics (Topics and Things, i.e. game objects) that this fact relates to.

Methods  

addSource (source, actor, =, gPlayerChar)facts.t[160]

Add a source (of information) to our sourcesTab table.

addTarget (target, actor, =, gPlayerChar)facts.t[181]
Add a target to our targetTab table

currentlyKnownBy ( )facts.t[95]
Obtain a list of everything that knows this fact

getPcComment (source, topic)facts.t[306]
Get the current player character's comment on this Fact; source is the source from which the PC learned the Fact and topic is the topic the Player Character is thinking about. By default this method returns different results for different player characters, but game code will need to override this method to return different comments for different sources and/or topics.

getSources (actor, =, gPlayerChar)facts.t[205]
Get a list of the sources who have imparted this Fact to actor; actor dafaults to the player character and must normally have been the player character at some point for this to return anything but an empty list.

getTargets (actor, =, gPlayerChar)facts.t[215]
Get a list of the targets actor has imparted this Fact to; actor dafaults to the player character and must normally have been the player character at some point for this to return anything but an empty list.

initializeFact ( )facts.t[113]
Initialise this fact at preInit.

qualifiedDesc (source, topic, sender)facts.t[42]
We can if we wish vary the way this fact is described according to the source that's supplying it and the topic matched by the TopicEntry that's called this method; by default we just return desc here. Note that any such variation shouldn't change the content of the description but only the way it's phrased; e.g. 'Madrid is the capital of Spain' rather than 'the capital of Spain is Madrid' depending on whether the topic is Madrid or Spain.

By default we try to adapt the desc to the source and sender if it contains an actorParamName in square brackets, e.g. [bob], which we replace with 'Bob', 'I' or 'he' according to context

setPcComment (actor, txt)facts.t[324]
Set actor's comment on this fact; normally actor will be the current player character; txt is a single-quoted string containing the comment, which will usually be appended to the description of the fact.

sourceIntro (listSources)facts.t[226]
If our caller wants to list sources of information (listSources = true), then return a string containing a suitably formatted list of sources; otherwise return nil. This can then be used by TopicEntries (typically Thoughts) that want to list the sources of information along with the content of that information.

Adv3Lite Library Reference Manual
Generated on 25/04/2024 from adv3Lite version 2.0