Code supplied from the recipe book; edited down:
[code]Street in Kolonaki is a room. “There is a single round table out on the street here, and a window more or less at knee level looks down into the Olive Tree Gyro Shop, which is partly basement.”
Olive Tree Gyro Shop is inside from Street in Kolonaki. Kostis is a man in the Gyro Shop.
The can’t reach through closed window rule is listed instead of the can’t reach inside rooms rule in the reaching inside rules.
This is the can’t reach through closed window rule:
let reaching through the window be false;
if the container in question is a room and the container in question is not the location:
if the container in question is the Street and the location is the Olive Tree Gyro Shop:
now reaching through the window is true;
if the container in question is the Gyro Shop and the location is the Street:
now reaching through the window is true;
if reaching through the window is true:
if the window is closed:
say “You can’t reach through the closed window.”;
deny access;
otherwise:
allow access;
otherwise:
say “You can’t reach into [the container in question] from here.”;
deny access.
After looking when a room (called the next room) is adjacent:
try examining the next room.
Instead of examining a supporter, say “On [the noun] [is-are a list of things on the noun].” Instead of examining an open container, say “In [the noun] [is-are a list of things in the noun].”
The window is a backdrop. It is in the Street and the Shop. The window can be openable. The window can be open. The window is openable and closed. Instead of searching the window in the Street: try examining the shop. Instead of searching the window in the Shop: try examining the street.
Understand “examine [any adjacent room]” as examining.
Instead of examining a room:
say “Over in [the noun], you can see [a list of visible things in the noun].”
After deciding the scope of the player:
if the player is in the Street, place the Shop in scope;
if the player is in the Shop, place the Street in scope.
[/code]
Added code:
The storage room is west of the Gyro Shop.
Every turn:
if Kostis is in the Gyro Shop:
try Kostis going west;
This is the built in example to demonstrate a window that can be seen through and also reached through.
I’m using this code in a situation where the player is locked in a prison cell and can reach various objects through the bars of the cell.
The problem arises when an NPC enters or leaves the other room from where the player is.
When the NPC leaves the room to the west, the report rule prints out:
The problem seems to be some combination of the intermediary room being in scope which makes the third room “adjacent”. Any possible insight or work-around would be appreciated.