A Nested Room is any object that isn't a room but which can contain an actor: chairs, beds, platforms, vehicles, and the like.

An important property of nested rooms is that they're not full-fledged rooms for the purposes of actor arrivals and departures. Specifically, an actor moving from a room to a nested room within the room does not trigger an actor.travelTo invocation, but simply moves the actor from the containing room to the nested room. Moving from the nested room to the containing room likewise triggers no actor.travelTo invocation. The travelTo method is not applicable for intra-room travel because no TravelConnector objects are traversed in such travel; we simply move in and out of contained objects. To mitigate this loss of notification, we instead call actor.travelWithin() when moving among nested locations.

By default, an actor attempting to travel from a nested location via a directional command will simply attempt the travel as though the actor were in the enclosing location.

class NestedRoom :   BasicLocation

Superclass Tree   (in declaration order)


Subclass Tree  


Global Objects  


Summary of Properties  

bulkCapacity  exitDestination  mustMoveIntoProp  out  roomName  stagingLocations 

Inherited from BasicLocation :
cannotGoThatWayMsg  defaultPosture  effectiveFollowLocation  listWithActorInTable  mustDefaultPostureProp  notTravelReadyMsg  roomLocation  roomNotifyList  roomTravelPreCond 

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  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  objectNotifyList  objInPrep  obscuredInitSpecialDesc  obscuredSpecialDesc  owner  patElevenEighteen  patIsAlpha  patLeadingTagOrQuote  patOfPhrase  patOneLetterAnWord  patOneLetterWord  patSingleApostropheS  patTagOrQuoteChar  patUpperOrDigit  patVowelY  pluralDisambigName  pluralName  pronounSelector  roomDarkName  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 

Summary of Methods  

cannotMoveActorOutOf  cannotMoveActorToStagingLocation  checkActorInStagingLocation  checkActorOutOfNested  checkActorReadyToEnterNestedRoom  checkMovingActorInto  chooseStagingLocation  defaultStagingLocation  disembarkRoom  dobjFor(GetOutOf)  dobjFor(Take)  getExtraScopeItems  isOwnedBy  isStagingLocationKnown  makeStandingUp  mapPushTravelIobj  removeFromNested  roomTravelPreCond  tryMovingIntoNested  tryRemovingFromNested 

Inherited from BasicLocation :
actorInGroupPrefix  actorInGroupSuffix  actorIsFamiliar  actorKnowsDestination  actorTravelingWithin  addRoomNotifyItem  cannotGoShowExits  cannotGoThatWay  cannotGoThatWayInDark  cannotTravel  checkStagingLocation  checkTravelerDirectlyInRoom  dispatchRoomDaemon  enteringRoom  getDropDestination  getNominalActorContainer  getNominalDropDestination  getRoomNotifyList  getStatuslineExitsHeight  isActorTravelReady  leavingRoom  listWithActorIn  removeRoomNotifyItem  roomActorHereDesc  roomActorPostureDesc  roomActorStatus  roomActorThereDesc  roomAfterAction  roomBeforeAction  roomDarkTravel  roomDesc  roomListActorPosture  roomOkayPostureChange  showStatuslineExits  travelerArriving  travelerLeaving  tryMakingDefaultPosture  tryMakingTravelReady  wouldBeLitFor 

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  cannotReachObject  cannotSeeSmellSource  cannotSeeSoundSource  canOwn  canSee  canSmell  canThrowViaPath  canTouch  canTouchViaPath  checkBulkChange  checkBulkChangeWithin  checkMoveViaPath  checkThrowViaPath  checkTouchViaPath  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(Consult)  dobjFor(ConsultAbout)  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(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(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  getEncumberingBulk  getEncumberingWeight  getHitFallDestination  getIdentityObject  getInScopeDistinguisher  getListedContents  getLocPushTraveler  getLocTraveler  getMovePathTo  getNoise  getNominalOwner  getObjectNotifyList  getOdor  getOutermostRoom  getOutermostVisibleRoom  getRoomPartLocation  getStateWithInfo  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)  isComponentOf  isDirectlyIn  isHeldBy  isIn  isInFixedIn  isListed  isListedInContents  isListedInInventory  isListedInRoomPart  isLookAroundCeiling  isNominallyIn  isNominallyInRoomPart  isOccludedBy  isOrIsIn  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  roomContentsLister  roomDaemon  roomDarkDesc  roomFirstDesc  roomRemoteDesc  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  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 



The maximum bulk the room can hold. We'll define this to a large number by default so that bulk isn't a concern.

Lower numbers here can be used, for example, to limit the seating capacity of a chair.

Our exit destination. This is where an actor ends up when the actor is immediately inside this nested room and uses a "get out of" or equivalent command to exit the nested room.

By default, we'll use the default staging location as the exit destination.

message property to use for reportFailure when tryMovingIntoNested fails

By default, 'out' within a nested room should take us out of the nested room itself. The easy way to accomplish this is to set up a 'nestedRoomOut' connector for the nested room, which will automatically try a GET OUT command. If we didn't do this, we'd *usually* pick up the noTravelOut from our enclosing room, but only when the enclosing room didn't override 'out' to point somewhere else. Explicitly setting up a 'noTravelOut' here ensures that we'll consistently GET OUT of the nested room even if the enclosing room has its own 'out' destination.

Note that nestedRoomOut shows as a listed exit in exit listings (for the EXITS command and in the status line). If you don't want OUT to be listed as an available exit for the nested room, you should override this to use noTravelOut instead.

Our interior room name. This is the status line name we display when an actor is within this object and can't see out to the enclosing room. Since we can't rely on the enclosing room's status line name if we can't see the enclosing room, we must provide one of our own.

By default, we'll use our regular name.

The valid "staging locations" for this nested room. This is a list of the rooms from which an actor can DIRECTLY reach this nested room; in other words, the actor will be allowed to enter 'self', with no intervening travel, if the actor is directly in any of these locations.

If the list is empty, there are no valid staging locations.

The point of listing staging locations is to make certain that the actor has to go through one of these locations in order to get into this nested room. This ensures that we enforce any conditions or trigger any side effects of moving through the staging locations, so that a player can't bypass a puzzle by trying to move directly from one location to another without going through the required intermediate steps. Since we always require that an actor go through one of our staging locations in order to enter this nested room, and since we carry out the travel to the staging location using implied commands (which are just ordinary commands, entered and executed automatically by the parser), we can avoid having to code any checks redudantly in both the staging locations and any other nearby locations.

By default, an actor can only enter a nested room from the room's direct container. For example, if a chair is on a stage, an actor must be standing on the stage before the actor can sit on the chair.


cannotMoveActorOutOf ( )travel.t[6087]

Report that we are unable to move an actor out of this nested room, because there's no valid 'exit destination'. This is called when we attempt to GET OUT OF the nested room, and the 'exitDestination' property is nil.

cannotMoveActorToStagingLocation ( )travel.t[6075]
Report that we are unable to move an actor to any staging location for this nested room. By default, we'll generate the message "you can't do that from here," but this can overridden to provide a more specific if desired.

checkActorInStagingLocation (allowImplicit)travel.t[5927]
Check, using precondition rules, that the actor is in a valid "staging location" for entering this nested room. We'll ensure that the actor is directly in one of the locations in our stagingLocations list, running an appropriate implicit command to move the actor to the first item in that list if the actor isn't in any of them.

This isn't normally overridden in subclasses.

checkActorOutOfNested (allowImplicit)OVERRIDDENtravel.t[5862]
Check, using pre-condition rules, that the actor is removed from this nested location and moved to my immediate location. This is used to enforce a precondition that the actor is in the enclosing location.

This isn't normally overridden in subclasses.

checkActorReadyToEnterNestedRoom (allowImplicit)OVERRIDDENtravel.t[5889]
Check, using pre-condition rules, that the actor is ready to enter this room as a nested location.

This isn't normally overridden in subclasses.

checkMovingActorInto (allowImplicit)OVERRIDDENtravel.t[5814]
Try moving the actor into this location. This is used to move the actor into this location as part of meeting preconditions, and we use the normal precondition check protocol: we return nil if the condition (actor is in this room) is already met; we return true if we successfully execute an implied command to meet the condition; and we report a failure message and terminate the command with 'exit' if we don't know how to meet the condition or the implied command we try to execute fails or fails to satisfy the condition.

This does not normally need to be overridden in subclasses.

chooseStagingLocation ( )travel.t[6022]
Choose an intermediate staging location, given the actor's current location. This routine is called when the actor is attempting to move into 'self', but isn't in any of the allowed staging locations for 'self'; this routine's purpose is to choose the staging location that the actor should implicitly try to reach on the way to 'self'.

By default, we'll attempt to find the first of our staging locations that indirectly contains the actor. (We know none of the staging locations directly contains the actor, because if one did, we wouldn't be called in the first place - we're only called when the actor isn't already directly in one of our staging locations.) This approach is appropriate when nested rooms are related purely by containment: if an actor is in a nested room within one of our staging locations, we can reach that staging location by having the actor get out of the more deeply nested room.

However, this default approach is not appropriate when nested rooms are related in some way other than simple containment. We don't have any general framework for other types of nested room relationships, so this routine must be overridden in such a case with special-purpose code defining the special relationship.

If we fail to find any staging location indirectly containing the actor, we'll return the result of defaultStagingLocation().

defaultStagingLocation ( )travel.t[6050]
The default staging location for this nested room. This is the staging location we'll attempt to reach implicitly if the actor isn't in any of the rooms in the stagingLocations list already. We'll return the first element of our stagingLocations list for which isStagingLocationKnown returns true.

disembarkRoom ( )OVERRIDDENtravel.t[5695]
An actor is attempting to "get out" while in this location. By default, we'll treat this as getting out of this object. This can be overridden if "get out" should do something different.

"get out of" action - exit the nested room

We cannot take a nested room that the actor is occupying

getExtraScopeItems (actor)OVERRIDDENtravel.t[5663]
Get the extra scope items within this room. Normally, the immediately enclosing nested room is in scope for an actor in the room. So, if the actor is directly in 'self', return 'self'.

isOwnedBy (obj)OVERRIDDENtravel.t[5645]
Check for ownership. For a nested room, an actor can be taken to own the nested room by virtue of being inside the room - the chair Bob is sitting in can be called "bob's chair".

If we don't have an explicit owner, and the potential owner 'obj' is in me and can own me, we'll report that 'obj' does in fact own me. Otherwise, we'll defer to the inherited implementation.

isStagingLocationKnown (loc)travel.t[6154]
Is the given staging location "known"? This returns true if the staging location is usable as a default, nil if not. If this returns true, then the location can be used in an implied command to move the actor to the staging location in order to move the actor into self.

If this returns nil, no implied command will be attempted for this possible staging location. This doesn't mean that an actor gets a free pass through the staging location; on the contrary, it simply means that we won't try any automatic command to move an actor to the staging location, hence travel from a non-staging location to this nested room will simply fail. This can be used when part of the puzzle is to figure out that moving to the staging location is required in the first place: if we allowed an implied command in such cases, we'd give away the puzzle by solving it automatically.

By default, we'll treat all of our staging locations as known.

makeStandingUp ( )OVERRIDDENtravel.t[5706]
Make the actor stand up from this location. By default, we'll cause the actor to travel (using travelWithin) to our container, and assume the appropriate posture for the container.

mapPushTravelIobj (PushTravelGetOutOf, TravelVia)travel.t[6249]
explicitly define the push-travel indirect object mappings

removeFromNested ( )travel.t[5796]
Replace the current action with one that removes the actor from this nested room. This is used to implement the GET OUT command when the actor is directly in this nested room. In most cases, this should simply be implemented with a call to replaceAction() with the appropriate command.

roomTravelPreCond ( )OVERRIDDENtravel.t[6162]
Get the travel preconditions for an actor in this location. By default, if we have a container, and the actor can see the container, we'll return its travel preconditions; otherwise, we'll use our inherited preconditions.

tryMovingIntoNested ( )travel.t[5760]
Try an implied command to move the actor from outside of this nested room into this nested room. This must be overridden in subclasses to carry out the appropriate implied command. Returns the result of tryImplicitAction().

This is called when we need to move an actor into this location as part of an implied command. We use an overridable method because different kinds of nested rooms have different commands for entering: SIT ON CHAIR, LIE ON BED, GET IN CAR, RIDE BIKE, and so on. This should be normally be overridden imply by calling tryImplicitAction() with the appropriate command for the specific type of nested room, and returning the result.

tryRemovingFromNested ( )travel.t[5783]
Try an implied command to remove an actor from this location and place the actor in my immediate containing location. This must be overridden in subclasses to carry out the appropriate implied command. Returns the result of tryImplicitAction().

This is essentially the reverse of tryMovingIntoNested(), and should in most cases be implemented by calling tryImplicitAction() with the appropriate command to get out of the room, and returning the result.

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3