Making a "look into kennel room" command synonymous with "look through window"

I have two rooms (an observation room and a kennel room) separated by a window. I was successfully able to allow the player to look through the window, but I’d also like it so that the player could type something akin to “look into kennel room” or “look at kennels.” I know how to use understand to alias actions but how can I allow the player to reference the other room? One things I’ve tried:

An observation window is scenery in Observation Room. "The window is tougher than glass and reinforced with wire.  It would likely take a truck smashing into it to break through to the other side, and even then it’s more of a possibility than a certainty."

Instead of searching the observation window:
	say the description of Kennel Room.

Instead of examining the kennel room:
	say the description of Kennel Room. 

This just results in the response, You can't see any such thing.

Any thoughts on how I can implement this?

This might be surprising to you (it surprised me), but rooms other than the player’s location aren’t considered “in scope” by Inform, which means they can’t be acted upon (examined, for instance) without changing some things. This is very narrowly tailored to the situation:

after deciding the scope of the player while the location is observation room:
	place the kennel room in scope, but not its contents.

instead of doing anything other than examining to a room that is not the location:
	say "There isn't a lot I can do from this side of the window."

You can read about scope here.

Note that the room description won’t include what’s called the “locale description.” That’s the text Inform prints after room descriptions listing miscellaneous items, i.e., “You see a wrench here.”

1 Like

This is very narrowly tailored to the situation:

It’s much easier to create a scenery object called “kennel room” than to mess around with scope rules.

Another cheap yet effective solution:

Understand "kennel", "kennels", "room" as the observation window.

If you take this path, EXAMINE WINDOW and EXAMINE KENNELS are the same command, so you can’t have a separate description for the window. That’s often fine though.

2 Likes

hm, ayup. I’ve got scope on the brain these days, I guess.

1 Like

Oh okay, that works, thank you!

I actually had a follow-up question. For looking into the window, I created the Kennel Room (it needs to actually exist because my NPC can access it and its contents even if the player cannot), I simply used:

Instead of searching the observation window:
	say the description of Kennel Room;

And that works fine, for the most part. I was looking at the Standard Rules code, and wonder: would it be possible to directly access the activity used to print the locale description of a room (i.e., so I can basically print the locale description of Kennel Room via the safety of the Observation Room)?

1 Like

yes.

carry out the printing the locale description activity with the Kennel Room;

the output would read something like

In the Spotlight Booth you can see a bright orange traffic cone.

1 Like