The Four-Eyed Guide to TADS 3 by David Welbourn index
>smell >smell window |
smell matches VerbRule(SmellImplicit) which invokes SmellImplicitAction. SmellImplicitAction, behind the scenes, tries to find out what's nearby that has a smell. More formally, it makes a list of all the objects within the actor's scope of smell that also have a smellPresence. If the list isn't empty, it would then report all their smells. However, when the list is empty, gActor.getActionMessageObj.nothingToSmell is printed instead.
smell window matches VerbRule(Smell) which invokes SmellAction. To keep this example simple, we will assume that the window is near the player, that is, in the scope of gActor's sense of smell. We will assume that the window is not distant from the player. We will assume that neither the player nor the window is inside, on, or otherwise near some third object that might block a smell, dim a smell, or make the relationship between the player and window anything less than straightforward. When no smell has been defined for an object, libMessages.thingSmellDesc(obj) is printed.
Note that these two responses, although they look identical, are generated from distinct default messages in the library and can be replaced independently. See [LINK about replacing default library messages].
In TADS 3, smelling is modeled on the more generic concept of sensing. Thus, the bulk of code used to handle smelling is done via superclasses about sensing. See [LINK about Senses].
>smell >smell Mac |
Forest: OutdoorRoom 'Forest' ; + SimpleOdor desc = "The air smells damp and earthy. Maybe it rained earlier. " ; + Mac: Person 'mac' 'Mac' smellDesc = "Mac is wearing enough deodorant to bankrupt Paraguay. " ; |
actions.t |
Short description |
---|---|
DefineTAction(Smell) |
Defines class SmellAction: TAction |
DefineAction(SmellImplicit, SenseImplicitAction) |
Defines class SmellImplicitAction: SenseImplicitAction |
Note: DefineTAction(name) and DefineAction(name, baseClass...) are macros defined in adv3.h. |
Note: TAction is a class defined in action.t. SenseImplicitAction is a class defined in actions.t, but defined via DefineIAction(SenseImplicit). |
actor.t |
Short description |
Actor.scopeSenses |
Senses that determine scope for this actor. Default value: [sight, sound, smell]. |
Actor.smelllikeSenses |
Senses that the actor can use to smell objects. Default value: [smell]. |
Actor.canSmell(obj) |
Can the actor smell object obj? Returns true or nil. |
lister.t |
Short description |
roomSmellLister: SenseLister |
|
smellActionLister: roomSmellLister |
|
inventorySmellLister: SenseLister |
|
objects.t |
Short description |
Intangible.smellPresence |
(overrides |
Vaporous.dobjFor(Smell) |
|
class SensoryEmanation: Intangible |
|
SensoryEmanation.odorList |
|
class Odor: SensoryEmanation |
|
class SimpleOdor: Odor |
|
class SensoryEvent: object |
|
class SmellEvent: SensoryEvent |
|
SmellEvent.notifyProp = ¬ifySmellEvent |
|
class SmellObserver: object |
|
BasicContainer.cannotSeeSmellSource(obj) |
|
pov.t |
Short description |
callWithSenseContext(source, sense, func) |
|
senseContext: SwitchableCaptureFilter |
|
precond.t |
Short description |
objVisible: PreCondition |
calls inaccessible(&smelledButNotSeen, obj); |
objSmellable: PreCondition |
calls inaccessible(&cannotSmell, obj); |
class TouchObjCondition: PreCondition |
calls inaccessible(&smelledButNotSeen, obj); |
sense.t |
Short description |
Material.senseThru(sense) |
|
Material.smellThru = opaque |
|
class Sense: object |
|
smell: Sense |
|
smell.thruProp = &smellThru |
|
smell.sizeProp = &smellSize |
|
smell.presenceProp = &smellPresence |
|
class SenseConnector: MultiLoc |
|
class DistanceConnector: SenseConnector, Intangible |
|
thing.t |
Short description |
Thing.smellDesc |
This description of a Thing's smell is used when the Thing doesn't have an associated Odor object. Default value: libMessages.thingSmellDesc(self). |
Thing.distantSmellDesc |
|
Thing.obscuredSmellDesc(obs) |
|
Thing.smellHereDesc |
|
Thing.smellSize |
|
Thing.smellPresence |
|
Thing.getOdor |
|
Thing.cannotSeeSmellSource(obj) |
|
Thing.canBeSmelledBy(actor) |
|
Thing.canBeSmelled |
|
Thing.basicExamineSmell(explicit) |
|
Thing.dobjFor(Smell) |
|
en_us\en_us.t |
Short description |
VerbRule(Smell) |
Associates the grammar "smell dobjList" with SmellAction. |
VerbRule(SmellImplicit) |
Associates the grammar "smell" with SmellImplicitAction. |
Note: VerbRule(tag) is a macro defined in en_us.h. |
Note: SmellAction and SmellImplicitAction are defined in actions.t (see above). |
en_us\msg_neu.t |
Short description |
libMessages.thingSmellDesc(obj) |
"{You/he} smell{s} nothing out of the ordinary. " |
libMessages.distantThingSmellDesc(obj) |
"{You/he} can't smell much at this distance. " |
libMessages.obscuredThingSmellDesc(obj, obs) |
"{You/he} can't smell much through {the obs/him}. " |
libMessages.smellDescSeparator() |
"<.p>" |
libMessages.smellIsFromWithin(obj, loc) |
"\^<<obj.theName>> appear<<obj.verbEndingS>> to be coming from inside <<loc.theNameObj>>. " |
libMessages.smellIsFromWithout(obj, loc) |
"\^<<obj.theName>> appear<<obj.verbEndingS>> to be coming from outside <<loc.theNameObj>>. " |
playerActionMessages.smelledButNotSeen(obj) |
'{You/he} can smell {an obj/him}, but {you/he} can\'t see{s} {it obj/him}. ' |
playerActionMessages.cannotSmell(obj) |
'{You/he} cannot smell {that obj/him}. ' |
playerActionMessages.nothingToSmell |
'{You/he} smell{s} nothing out of the ordinary. ' |
playerActionMessages.odorSource(src) |
'{The dobj/he} seem{s} to be coming from ' + src.theNameObj + '. ' |