Mentionableclass | thing.t[18] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
class
Mentionable : LMentionable
Mentionable
LMentionable
object
Mentionable
Thing
Actor
Player
Button
Collective
DispensingCollective
Consultable
Container
Booth
OpenableContainer
KeyedContainer
LockableContainer
Door
DSDoor
SymDoor
SecretDoor
Fixture
CollectiveGroup
MobileCollectiveGroup
Component
ContainerDoor
Decoration
Distant
RoomPart
Ceiling
DefaultWall
SensoryEmanation
Noise
SimpleNoise
Odor
SimpleOdor
Unthing
Enterable
Heavy
Floor
Food
Immovable
Key
Lever
MinorItem
Passage
DSPassage
SymPassage
PathPassage
DSPathPassage
SymPathPassage
RearContainer
Room
OutdoorRoom
ScenItem
MultiScenItem
Settable
Dial
NumberedDial
SimpleAttachable
AttachableComponent
NearbyAttachable
Attachable
StairwayDown
StairwayUp
DSStairway
SymStairway
SubComponent
Surface
Platform
Bed
Chair
Switch
Flashlight
Underside
Wearable
Topic
ambiguouslyPlural
disambigGroup
disambigMatchPhrases
disambigName
disambigOrder
distinguishByContents
isHer
isHim
isIt
massNoun
matchPhrases
matchPhrasesExclude
name
nominalContents
person
plural
proper
qualified
roomTitle
states
vocab
vocabWords
Inherited from LMentionable
:
acronymPluralPat
alphaCharPat
aName
apostPluralPat
apostSPat
deannotatePat
dictComp
dummyName
elevenEighteenPat
emptyVocabWords
esPluralPat
firstWordPat
heName
herName
hersName
himName
iesPluralPat
irregularPlurals
lastWordPat
leadingTagOrQuotePat
menPluralPat
objInName
objIntoName
objName
objOutOfName
oneLetterAnWordPat
oneLetterWordPat
ownerNamed
pluralPat
posPat
possAdj
possEnding
possNoun
prepList
prepPhrasePat
prepWordPat
pronounMap
properNamePat
properPat
reflexiveName
specialAOrAn
tagOrQuotePat
thatName
thatObjName
theName
theObjName
trimPat
truncationLength
weakWordPat
construct
filterResolveList
matchName
matchNameCommon
matchNameDisambig
phraseMatchName
simpleMatchName
Inherited from LMentionable
:
addDictWord
addVocab
addVocabWord
aNameFrom
aNameFromPoss
classInit
contify
distinguishedName
ifPronoun
inheritVocab
initVocab
initVocabWord
locify
matchPronoun
pluralNameFrom
pluralWordFrom
possessify
pronoun
removeVocabWord
replaceVocab
theNameFrom
theNameIs
ambiguouslyPlural | thing.t[228] |
disambigGroup | thing.t[86] |
disambigMatchPhrases | thing.t[618] |
disambigName | thing.t[73] |
By default, this is the same as the short name. It's uncommon to override this, since short names are typically already detailed enough for most purposes. Every so often, though, you'll want to keep the short name very terse, so you'll leave out some distinguishing detail that it *could* have had. In such cases, you can add the distinguishing detail here, so that it's displayed only when it's really needed.
disambigOrder | thing.t[103] |
This property is useful for grouped objects with a natural ordering, such as items with sequential labels of some sort (numbers, letters, etc). You can use this property to ensure that lists of these items will be displayed in the natural order: "button 1, button 2, or button 3?" or "the door on the left, the door in the middle, or the door on the right?"
distinguishByContents | thing.t[272] |
isHer OVERRIDDEN | thing.t[204] |
isHim OVERRIDDEN | thing.t[203] |
isIt OVERRIDDEN | thing.t[202] |
The default is neuter. Use isHim and isHer to give an object masculine and/or feminine gender. Use isIt to explicitly give an object neuter gender. By default, we infer isIt from isHim and isHer: we assume the object is neuter if it's not masculine or feminine.
Languages that have grammatical gender will almost certainly want to parse articles in the 'vocab' property to make it more convenient to encode each object's gender. For example, a French implementation could parse 'le' or 'la' at the start of a vocab string and set isHim and isHer accordingly.
The English library sets isHim and isHer if 'him' and 'her' (respectively) are found in the object's pronoun list. (This is the most convenient way to represent gender via the vocab string in English, since English doesn't have gendered articles.)
Note that we define the genders as three separate properties, so the genders are NOT mutually exclusive - an object can be a "him", a "her", and an "it" at the same time. This is because a single object can have multiple grammatical genders in some languages. In English, for example, an animal can be referred to as gendered (matching its physical gender) or neuter; and a few inanimate objects have a sort of optional, idiomatic gender, such as referring to a ship or country as "her".
Some languages might need additional genders. When needed, LMentionable should simply define suitable additional properties.
In most gendered languages, the grammatical gender is an attribute of the noun, not of the object. In particular, if an object has two nouns in its vocabulary, the two nouns might be of different genders. The language module might therefore limit the use of isIt et al to the gender of the object's name string as it appears in output (e.g., for selecting an article when showing the name in a list, or selecting a pronoun to represent the object), and use a completely different scheme to tag the gender of individual vocabulary words. One approach would be to use separate mNoun and fNoun token properties (and more if needed) to distinguish the gender of individual nouns in the dictionary.
massNoun | thing.t[247] |
In English, mass nouns use "some" as the indefinite article rather than "a" (some sand, not a sand). Their plural usage tends to differ from regular nouns, in that they already carry a sense of plurality; if you have two distinct piles of sand, the two together are usually still just "sand", not "two sands".
When a mass noun is awkward as an object's name, you can often make it into a regular noun by naming its overall form. "Sand" is a mass noun, but recasting it as "pile of sand" makes it an ordinary noun. (The generic way to do this for a homogeneous substance is to add "quantity of".)
matchPhrases | thing.t[608] |
matchPhrasesExclude | thing.t[626] |
name | thing.t[37] |
nominalContents | thing.t[263] |
Note that this is always a single object (or nil), not the whole list of contents. We can only be named by one content object. (So you can't have a "box of books and papers" by having separate nominal contents objects for the books and the papers; although you could fake it by creating a "books and papers" object.)
person | thing.t[152] |
Usually, every object in the game will be in the third person - *except* the player character object, which is usually in the second person. The library doesn't care which person you use for the player character, though - you're free to use first or third person if you prefer. First-person and third-person IF are relatively uncommon, but not unheard of.
This property is used for verb agreement when library messages are generated. This ensures that library messages adapt to the correct narrative person of the story automatically. To write a first-person game, you don't have to replace all of the default messages, but simply set person=1 in your PC object.
plural | thing.t[221] |
The English library sets this to true if 'them' is listed as a pronoun for the object in the 'vocab' property.
proper | thing.t[123] |
This property controls how the library shows the object's name in generated messages. In English, for example, articles (a, the) aren't used with a proper name.
The English library tries to infer whether the object has a proper name based on the 'vocab' string: if all the words in the short name are capitalized, we'll consider it a proper name. This rule of thumb doesn't always apply, though, so you can override it: simply set 'proper' explicitly in an individual object, and the setting will take precedence over whatever the name's capitalization would otherwise imply. (Other languages might have different rules for inferring 'proper', and some might not be able to infer it at all.)
qualified | thing.t[132] |
roomTitle | thing.t[57] |
The room title essentially serves as a label for the room on the player's mental and/or paper map of the game's geography. It's usually something short and pithy that sums up the room's essence, function, or appearance, and is usually written in title case: Ice Cave, Bank Lobby, Front of House, Transporter Room 3, etc.
The room headline sometimes adds more status information to the title, such as the point-of-view actor's direct container when the actor is inside an intermediate container within the room, such as a chair.
states | thing.t[655] |
vocab | thing.t[28] |
The syntax is language-specific - see initVocab() for details.
vocabWords | thing.t[652] |
construct ( ) | thing.t[634] |
filterResolveList (np, cmd, mode) | thing.t[672] |
np is the noun phrase, so np.matches gives the current list of matches, and np.matches[i].obj gives the ith object match. To change the list of matches, manipulate the np.matches list.
cmd is the command object, so that cmd.action gives the action about to be executed.
mode is the match mode.
By default we do nothing here.
matchName (tokens) | thing.t[313] |
By default, we call simpleMatchName(), which matches the name if all of the words in the token list are in the object's vocabulary list, regardless of word order.
In most cases, an unordered word match works just fine. The obvious drawback with this approach is that it's far too generous at matching nonsense phrases to object names - DUSTY OLD SPELL BOOK and BOOK DUSTY SPELL OLD are treated the same. In most cases, users won't enter nonsense phrases like that anyway, so they'll probably never notice that we accept them. If they enter something like that intentionally, we can plead Garbage In/Garbage Out: a user who willfully types a nonsense command has only himself to blame for a nonsense reply.
Occasionally, though, there are reasons to be pickier. When these come up, you can override matchName() to be as picky as you like.
The most common situation where pickiness is called for is when two objects happen to share some of the same vocabulary words, but certain words orderings clearly refer to only one or the other. With the unordered approach, this can be a nuisance for the player because it can trigger disambiguation questions that seem unnecessary. Overriding matchName() to be picky about word order for those specific objects can often fix this. In this implementation the matchPhrases property can be used for this purpose.
Another example is ensuring the user knows the correct full name of an object as part of a puzzle: you can override matchName() to make sure the user doesn't accidentally stumble on the object by using one of its vocabulary words to refer to something else nearby. Another example is matching words that aren't in the vocabulary list, such as a game object that represents a group of apparent objects that have a whole range of labels ("post office box 123", say).
matchNameCommon (tokens, phrases, excludes) | thing.t[325] |
matchNameDisambig (tokens) | thing.t[418] |
Now, you might think we should handle these replies by just appending them to the original noun phrase in the input. But we can't just do that: matchName() *could* care about the order of the words in the noun phrase, so we can't just assume that we can stick them in somewhere and still have a valid name for the object. So, instead of doing that, we call this routine with the phrase from the player's answer to the "Which one" question. Since this routine knows that the new words aren't part of the original phrase, it can deal with them as it sees fit with respect to word order.
The default here, of course, is to do the same thing as the default matchName(): we simply call simpleMatchName() to match the input to the object vocabulary, ignoring word order. This will usually work even when matchName() is overridden to care about word order, since the added words here are just serving to distinguish one object from another.
phraseMatchName (phrases, tokens) | thing.t[541] |
simpleMatchName (tokens) | thing.t[438] |