Consultableclass
A “consultable” object. This is an inanimate object that can be consulted about various topics, almost the way an actor can be asked about topics. Examples include individual objects that contain voluminous information, such as books, phone directories, and maps, as well as collections of individual information-carrying objects, such as file cabinets or bookcases.
A consultable keeps a database of TopicEntry objects; this works in much the same way as the topic database system that actors use. Create one or more ConsultTopic objects and place them inside the Consultable (using the ‘location’ property, or using the ‘+’ syntax). When an actor consults the object about a topic, we’ll search our database for a ConsultTopic object that matches the topic and is currently active, and show the response for the best one we can find.
From an IF design perspective, consultables have two nice properties.
First, they hide the boundaries of implementation, by letting the game *suggest* that there’s an untold wealth of information in a particular book (or whatever) without the need to actually implement all of it. We only have to show the entries the player specifically asks for, so the game never has to admit when it’s run out of things to show, and the player can never know for sure that there’s not more to find. Be careful, though, because this is a double-edge sword, design-wise; it’s easy to abuse this property to hide information gratuitously from the player.
Second, consultables help “match impedances” between the narrative level of detail and the underlying world model. At the narrative level, we paint in fairly broad strokes: when we visit a new location, we describe the *important* features of the setting, not every last detail. If the player wants to examine something in closer detail, we zoom in on that detail, assuming we’ve implemented it, but it’s up to the player to determine where the attention is focused. Consultable objects give us the same capability for books and the like. With a consultable, we can describe the way a book looks without immediately dumping the literal contents of the book onto the screen; but when the player chooses some aspect of the book to read in detail, we can zoom in on that page or chapter and show that literal content, if we choose.
Also, note that we assume that consultables convey their information through visual information, such as printed text or a display screen. Because of this, we by default require that the object be visible to be consulted. This might not be appropriate in some cases, such as Braille books or talking PDA’s; to remove the visual condition, override the pre-condition for the Consult action.
class
Consultable
:
Thing
TopicDatabase
Superclass Tree (in declaration order)
Consultable
Thing
VocabObject
` object
[
TopicDatabase](../object/TopicDatabase.html)
object`
Subclass Tree
(none)
Global Objects
(none)
Summary of Properties
Inherited from Thing
:
actorInAName
actorInName
actorInPrep
actorIntoName
actorOutOfName
actorOutOfPrep
aDisambigName
allStates
aName
brightness
bulk
canBeHeard
canBeSeen
canBeSmelled
canBeTouched
canMatchHer
canMatchHim
canMatchIt
canMatchThem
circularlyInMessage
collectiveGroup
collectiveGroups
contents
contentsListed
contentsListedInExamine
contentsListedSeparately
contentsLister
descContentsLister
described
disambigEquivName
disambigName
distantDesc
distantInitSpecialDesc
distantSpecialDesc
distinguishers
dummyName
effectiveFollowLocation
equivalenceKey
equivalentGrouper
equivalentGrouperClass
equivalentGrouperTable
esEndingPat
explicitVisualSenseInfo
getState
globalParamName
holdingIndex
iesEndingPat
initDesc
initNominalRoomPartLocation
initSpecialDesc
inlineContentsLister
isEquivalent
isHer
isHim
isInInitState
isKnown
isLikelyCommandTarget
isListedAboardVehicle
isMassNoun
isPlural
isProperName
isQualifiedName
isThingConstructed
isTopLevel
listName
listWith
location
lookInLister
moved
name
nameDoes
nameSays
nameSees
notTravelReadyMsg
objectNotifyList
objInPrep
obscuredInitSpecialDesc
obscuredSpecialDesc
owner
patElevenEighteen
patIsAlpha
patLeadingTagOrQuote
patOfPhrase
patOneLetterAnWord
patOneLetterWord
patSingleApostropheS
patTagOrQuoteChar
patUpperOrDigit
patVowelY
pluralDisambigName
pluralName
pronounSelector
roomDarkName
roomLocation
roomName
seen
sightPresence
sightSize
smellPresence
smellSize
soundPresence
soundSize
specialContentsLister
specialDesc
specialDescBeforeContents
specialDescListWith
specialDescOrder
specialNominalRoomPartLocation
suppressAutoSeen
takeFromNotInMessage
theDisambigName
theName
theNamePossNoun
tmpAmbient_
tmpAmbientFill_
tmpAmbientWithin_
tmpFillMedium_
tmpObstructor_
tmpObstructorWithin_
tmpPathIsIn_
tmpTrans_
tmpTransWithin_
touchPresence
touchSize
verbCan
verbCannot
verbCant
verbEndingSD
verbEndingSEd
verbEndingSMessageBuilder_
verbMust
verbToCome
verbToDo
verbToGo
verbToLeave
verbToSay
verbToSee
verbWill
verbWont
weight
Inherited from VocabObject
:
canResolvePossessive
disambigPromptOrder
pluralOrder
vocabLikelihood
vocabWords
weakTokens
Inherited from TopicDatabase
:
limitSuggestions
suggestedTopics
topicGroupActive
topicGroupScoreAdjustment
Summary of Methods
dobjFor(Consult)
dobjFor(ConsultAbout)
resolveConsultTopic
topicNotFound
Inherited from Thing
:
acceptCommand
addAllContents
addDirectConnections
addObjectNotifyItem
addToContents
addToSenseInfoTable
adjustLookAroundTable
adjustThrowDestination
afterAction
afterTravel
allContents
aNameFrom
aNameObj
aNameOwnerLoc
announceDefaultObject
appendHeldContents
atmosphereList
baseMoveInto
basicExamine
basicExamineFeel
basicExamineListen
basicExamineSmell
basicExamineTaste
beforeAction
beforeTravel
buildContainmentPaths
cacheAmbientInfo
cacheSenseInfo
cacheSensePath
canBeHeardBy
canBeSeenBy
canBeSensed
canBeSmelledBy
canBeTouchedBy
canDetailsBeSensed
canHear
canMatchPronounType
canMoveViaPath
cannotGoShowExits
cannotReachObject
cannotSeeSmellSource
cannotSeeSoundSource
canOwn
canSee
canSmell
canThrowViaPath
canTouch
canTouchViaPath
checkActorOutOfNested
checkBulkChange
checkBulkChangeWithin
checkMoveViaPath
checkStagingLocation
checkThrowViaPath
checkTouchViaPath
checkTravelerDirectlyInRoom
childInName
childInNameGen
childInNameWithOwner
childInRemoteName
clearSenseInfo
cloneForMultiInstanceContents
cloneMultiInstanceContents
conjugateRegularVerb
connectionTable
construct
contentsInFixedIn
countDisambigName
countListName
countName
countNameFrom
countNameOwnerLoc
darkRoomContentsLister
defaultDistantDesc
defaultObscuredDesc
desc
directionForConnector
distantSmellDesc
distantSoundDesc
dobjFor(AskAbout)
dobjFor(AskFor)
dobjFor(AskVague)
dobjFor(AttachTo)
dobjFor(Attack)
dobjFor(AttackWith)
dobjFor(Board)
dobjFor(Break)
dobjFor(Burn)
dobjFor(BurnWith)
dobjFor(Clean)
dobjFor(CleanWith)
dobjFor(Climb)
dobjFor(ClimbDown)
dobjFor(ClimbUp)
dobjFor(Close)
dobjFor(CutWith)
dobjFor(Detach)
dobjFor(DetachFrom)
dobjFor(Dig)
dobjFor(DigWith)
dobjFor(Doff)
dobjFor(Drink)
dobjFor(Drop)
dobjFor(Eat)
dobjFor(Enter)
dobjFor(EnterOn)
dobjFor(Examine)
dobjFor(Extinguish)
dobjFor(Fasten)
dobjFor(FastenTo)
dobjFor(Feel)
dobjFor(Flip)
dobjFor(Follow)
dobjFor(GetOffOf)
dobjFor(GetOutOf)
dobjFor(GiveTo)
dobjFor(GoThrough)
dobjFor(JumpOff)
dobjFor(JumpOver)
dobjFor(Kiss)
dobjFor(LieOn)
dobjFor(Light)
dobjFor(ListenTo)
dobjFor(Lock)
dobjFor(LockWith)
dobjFor(LookBehind)
dobjFor(LookIn)
dobjFor(LookThrough)
dobjFor(LookUnder)
dobjFor(Move)
dobjFor(MoveTo)
dobjFor(MoveWith)
dobjFor(Open)
dobjFor(PlugIn)
dobjFor(PlugInto)
dobjFor(Pour)
dobjFor(PourInto)
dobjFor(PourOnto)
dobjFor(Pull)
dobjFor(Push)
dobjFor(PushTravel)
dobjFor(PutBehind)
dobjFor(PutIn)
dobjFor(PutOn)
dobjFor(PutUnder)
dobjFor(Read)
dobjFor(Remove)
dobjFor(Screw)
dobjFor(ScrewWith)
dobjFor(Search)
dobjFor(Set)
dobjFor(SetTo)
dobjFor(ShowTo)
dobjFor(SitOn)
dobjFor(Smell)
dobjFor(StandOn)
dobjFor(Strike)
dobjFor(Switch)
dobjFor(Take)
dobjFor(TakeFrom)
dobjFor(TalkTo)
dobjFor(Taste)
dobjFor(TellAbout)
dobjFor(TellVague)
dobjFor(Throw)
dobjFor(ThrowAt)
dobjFor(ThrowDir)
dobjFor(ThrowTo)
dobjFor(Turn)
dobjFor(TurnOff)
dobjFor(TurnOn)
dobjFor(TurnTo)
dobjFor(TurnWith)
dobjFor(TypeLiteralOn)
dobjFor(TypeOn)
dobjFor(Unfasten)
dobjFor(UnfastenFrom)
dobjFor(Unlock)
dobjFor(UnlockWith)
dobjFor(Unplug)
dobjFor(UnplugFrom)
dobjFor(Unscrew)
dobjFor(UnscrewWith)
dobjFor(Wear)
examineListContents
examineListContentsWith
examineSpecialContents
examineStatus
failCheck
feelDesc
fillMedium
findOpaqueObstructor
findTouchObstructor
forEachConnectedContainer
forEachContainer
fromPOV
getAllForTakeFrom
getAllPathsTo
getAnnouncementDistinguisher
getBagAffinities
getBagsOfHolding
getBestDistinguisher
getBulk
getBulkWithin
getCarryingActor
getCommonContainer
getCommonDirectContainer
getConnectedContainers
getConnectorTo
getContentsForExamine
getDestName
getDropDestination
getEncumberingBulk
getEncumberingWeight
getExtraScopeItems
getHitFallDestination
getIdentityObject
getInScopeDistinguisher
getListedContents
getLocPushTraveler
getLocTraveler
getMovePathTo
getNoise
getNominalDropDestination
getNominalOwner
getObjectNotifyList
getOdor
getOutermostRoom
getOutermostVisibleRoom
getRoomNotifyList
getRoomPartLocation
getStateWithInfo
getStatuslineExitsHeight
getThrowPathTo
getTouchPathTo
getTravelConnector
getVisualSenseInfo
getWeight
hasCollectiveGroup
hideFromAll
hideFromDefault
initializeEquivalent
initializeLocation
initializeThing
inRoomName
iobjFor(AttachTo)
iobjFor(AttackWith)
iobjFor(BurnWith)
iobjFor(CleanWith)
iobjFor(CutWith)
iobjFor(DetachFrom)
iobjFor(DigWith)
iobjFor(FastenTo)
iobjFor(GiveTo)
iobjFor(LockWith)
iobjFor(MoveWith)
iobjFor(PlugInto)
iobjFor(PourInto)
iobjFor(PourOnto)
iobjFor(PutBehind)
iobjFor(PutIn)
iobjFor(PutOn)
iobjFor(PutUnder)
iobjFor(ScrewWith)
iobjFor(ShowTo)
iobjFor(TakeFrom)
iobjFor(ThrowAt)
iobjFor(ThrowTo)
iobjFor(TurnWith)
iobjFor(UnfastenFrom)
iobjFor(UnlockWith)
iobjFor(UnplugFrom)
iobjFor(UnscrewWith)
isActorTravelReady
isComponentOf
isDirectlyIn
isHeldBy
isIn
isInFixedIn
isListed
isListedInContents
isListedInInventory
isListedInRoomPart
isLookAroundCeiling
isNominallyIn
isNominallyInRoomPart
isOccludedBy
isOrIsIn
isOwnedBy
isShipboard
isVocabEquivalent
itIs
itNom
itObj
itPossAdj
itPossNoun
itVerb
listCardinality
localDirectionLinkForConnector
lookAround
lookAroundPov
lookAroundWithin
lookAroundWithinContents
lookAroundWithinDesc
lookAroundWithinName
lookAroundWithinSense
lookAroundWithinShowExits
lookInDesc
mainExamine
mainMoveInto
mapPushTravelHandlers
mapPushTravelHandlers
mapPushTravelHandlers
mapPushTravelHandlers
mapPushTravelHandlers
meetsObjHeld
mergeSenseInfo
mergeSenseInfoTable
moveInto
moveIntoForTravel
moveIntoNotifyPath
mustMoveObjInto
nameIs
nameIsnt
nameVerb
normalizePath
notePromptByOwnerLoc
notePromptByPossAdj
noteSeenBy
notifyInsert
notifyMoveInto
notifyMoveViaPath
notifyRemove
obscuredDesc
obscuredSmellDesc
obscuredSoundDesc
pluralNameFrom
processThrow
propHidesProp
propWithPresent
putInName
receiveDrop
remoteDesc
remoteInitSpecialDesc
remoteRoomContentsLister
remoteSpecialDesc
removeFromContents
removeObjectNotifyItem
restoreLocation
roomActorThereDesc
roomContentsLister
roomDaemon
roomDarkDesc
roomDesc
roomFirstDesc
roomRemoteDesc
roomTravelPreCond
saveLocation
selectPathTo
sendNotifyInsert
sendNotifyRemove
senseAmbientMax
senseInfoTable
senseObj
sensePathFromWithin
sensePathFromWithout
sensePathToContents
sensePathToLoc
sensePresenceList
setAllSeenBy
setContentsSeenBy
setGlobalParamName
setVisualSenseInfo
shineFromWithin
shineFromWithout
shineOnContents
shineOnLoc
showDistantSpecialDesc
showDistantSpecialDescInContents
showInventoryContents
showInventoryItem
showInventoryItemCounted
showListItem
showListItemCounted
showListItemCountedGen
showListItemGen
showObjectContents
showObscuredSpecialDesc
showObscuredSpecialDescInContents
showRemoteSpecialDesc
showRemoteSpecialDescInContents
showSpecialDesc
showSpecialDescInContents
showSpecialDescInContentsWithInfo
showSpecialDescWithInfo
showStatuslineExits
showWornItem
showWornItemCounted
smellDesc
smellHereDesc
soundDesc
soundHereDesc
specialDescList
specialPathFrom
statusName
stopThrowViaPath
superHidesSuper
tasteDesc
thatNom
thatObj
theNameFrom
theNameObj
theNameOwnerLoc
theNameWithOwner
throwTargetCatch
throwTargetHitWith
throwViaPath
transmitAmbient
transSensingIn
transSensingOut
traversePath
tryHolding
tryImplicitRemoveObstructor
tryMovingObjInto
useInitDesc
useInitSpecialDesc
useSpecialDesc
useSpecialDescInContents
useSpecialDescInRoom
useSpecialDescInRoomPart
verbEndingEs
verbEndingIes
verbEndingS
verbToHave
verbWas
verifyFollowable
verifyInsert
verifyMoveTo
verifyRemove
whatIf
whatIfHeldBy
withVisualSenseInfo
Inherited from VocabObject
:
addToDictionary
expandPronounList
filterResolveList
getFacets
inheritVocab
initializeVocab
initializeVocabWith
matchName
matchNameCommon
matchNameDisambig
throwNoMatchForLocation
throwNoMatchForPossessive
throwNothingInLocation
Inherited from TopicDatabase
:
addSuggestedTopic
addTopic
addTopicToList
compareVocabMatch
findTopicResponse
getTopicOwner
handleTopic
removeSuggestedTopic
removeTopic
removeTopicFromList
showSuggestedTopicList
showTopicResponse
Properties
consultTopics
Our topic entry database for consultatation topics. This will be automatically built during initialization from the set of ConsultTopic objects located within me, so there’s usually no need to initialize this manually.
Methods
dobjFor(Consult)
OVERRIDDEN
If they consult us without a topic, just ask for a topic. Treat it as logical, but rank it as improbable, in case there’s anything else around that can be consulted without any topic specified.
dobjFor(ConsultAbout)
OVERRIDDEN
consult about a topic
resolveConsultTopic (lst, np, resolver)
Resolve the topic phrase for a CONSULT ABOUT command. The CONSULT ABOUT action refers this to the direct object of the action, so that the direct object can filter the topic match according to what makes sense for the consultable.
By default, we resolve the topic phrase a little differently than we would for conversational commands, such as ASK ABOUT. By default, we don’t differentiate objects at all based on physical scope or actor knowledge when deciding on a match for a topic phrase. For example, if you create a Consultable representing a phone book, and the player enters a command like FIND BOB IN PHONE BOOK, the topic BOB will be found even if the ‘bob’ object isn’t known to the player character. The reason for this difference from ASK ABOUT et al is that consultables are generally the kinds of objects where, in real life, a person could browse through the object and come across entries whether or not the person knew enough to look for them. For example, you could go through a phone book and find an entry for “Bob” even if you didn’t know anyone named Bob.
‘lst’ is the list of ResolveInfo objects giving the full set of matches for the vocabulary words; ‘np’ is the grammar production object for the topic phrase; and ‘resolver’ is the TopicResolver that’s resolving the topic phrase. Note that ‘lst’ contains ResolveInfo objects, so to get the game-world object for a given list entry, use lst[i].obj_.
We return a ResolvedTopic object that encapsulates the matching objects.
Note that the resolver object can be used to get certain useful information. The resolver’s getAction() method returns the action (which you should use instead of gAction, since this routine is called during the resolution process, not during command execution); its getTargetActor() method returns the actor performing the action; and its objInPhysicalScope(obj) method lets you determine if an object is in physical scope for the actor.
topicNotFound ( )
show the default response for a topic we couldn’t find
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3