[I7] How to make windows

How can I make transparent windows? All I can figure out is making a window that’s actually a door, but if I look through it I just get the name of the room I see. Or I can make a transparent container. What’s the best way to make windows that are just secenery but respond to “look through x”

Well, if you can get the name of the room, you can probably do more stuff with the room – the trick is coming up with something sensible to print when you’re looking through a window at a particular room. You probably don’t want to just print its description.

Looking at section 3.6 of the Recipe Book, I’m guessing that you used something like example 20 for the window that’s the door and gives you the name of the room on the other side. You can get something a little more interesting by borrowing from example 217, which suggests that you use

"Over in [the noun], you can see [a list of visible things in the noun]." 

(where by some clever redirection the noun is the other side of the window you’re looking through). But you might also want some special cases there. So after some trials and errors I came up with this:

[code]A window is a kind of door. A window is usually closed and unopenable.
Instead of searching a window: say “Through [the noun], you can see [the window-text of the other side of the noun].”
Instead of examining a window: try searching the noun.

the Observation Room is a room. “The Entrance Bay is to the north.”
The Entrance Bay is north of the Observation Room. “The Observation Room is to the south, the Western Test Chamber is to the west, and the Eastern Test Chamber is to the east.”.
the Western Test Chamber is west of the Entrance Bay. An operating table is in western test chamber. The small observation window is a window. The small observation window is west of Observation Room and east of the Western Test Chamber.
the Eastern Test Chamber is east of the Entrance Bay. A gurney is in eastern test chamber. The large observation window is a window. It is east of Observation Room and west of the Eastern Test Chamber.

To say the window-text of (locale - the observation room): say “only your reflection in the one-way glass”

To say the window-text of (locale - a room):
say “[printed name of locale][if something is in locale], in which [is-are a list of things in the locale]”.[/code]

NB in order to make the more specific phrase for the observation room override the less specific phrase, you have to write “(locale - the observation room)” or something like that, even though you’re dealing with one specific thing rather than a variable!

Also, if you put a window in a room, you can’t have an ordinary exit leading out of the room in the same direction.

And it might well have been smarter to do what example 217 did and redirect searching the window to examining the other side of it, so you could put the window-text in rules for examining rooms rather than in say phrases.

This also may cause trouble if you have things that are in rooms but not visible, in which case you might have to write more complicated scope rules as in example 217.

Thanks!

Of course, if you do this, your players are going to try to examine and otherwise interact with things and people they see through the window…

When I did something similar to this, I used something like this.

[code]A window is a kind of door. A window is either clean or dirty. A window is dirty. A window is either broken or intact. A window is intact.

Definition: a window is seethrough:
if it is open begin;
decide yes;
otherwise if it is clean;
decide yes;
otherwise if it is broken;
decide yes;
otherwise;
decide no;
end if.

After deciding the scope of the player when a window is seethrough:
if the player is in (the room on side A of the window) begin;
place (the room on side B of the window) in scope;
otherwise if the player is in (the room on side B of the window);
place (the room on side A of the window) in scope;
end if.[/code]

Here, you can either clean, open or break the window in order to see through it.

Hope this helps.

Whoa - you mean you can just place an entire room in the scope like that and all items in it will follow? I thought you needed to loop through the items an add them one by one. Nice!

You sure can! You can also say “place (the object) in scope, but not its contents” to not include the contents. It’s all in “17.27. Deciding the scope of something” of the Inform 7 Documentation.