How to make a door transparent in I7

Hey, everybody. I’m new to interactive fiction, I just downloaded Inform 7 yesterday and I’ve already hit a few bumps. I want to create a cell door in a prison. You know, iron bars, but essentially see through. How do I write the source code to make it transparent? Or should I just put that in the description?

Depends on what you want to achieve. In Inform, each room is basically a sealed box, conceptually speaking. In order to create something like a window that can be looked through, you have to write a response to ‘look through window’ that fakes the action, since the stuff in the room that’s on the other side of the window is not in scope.

But there’s another solution, in your specific case: You could make the cell an openable lockable enterable transparent container. This container would be within a larger “room” called the Cell Block or something like that. Then the player’s location would be described as “Cell Block (in the cell)”, and anything else in the Cell Block, such as a jailer who comes and goes, would be in scope, so the player could examine it, converse with the jailer, or whatever.

Hope this helps. Have fun!

–JA

Talk about thinking outside the box! Yeah, I’ll give that a try, that also helps with adding more ‘cells’ to the ‘cell block’.

One thing to be cautious of: In some situations Inform can get confused if you use the same word to refer to two different objects – in this case, Cell and Cell Block. I would recommend calling the cell CellA (or something similar), and then add something like:

The printed name of CellA is “cell A”. Understand “cell” and “cell a” as CellA.

–JA

I already ran across that one, so I named it Cell 7B. Not that there’s a Cell 7A, yet.

Here’s another one. I want to make a lightbulb that you can switch on or off, and I can’t quite get the wording right. I’ve downloaded your pdf, where is the best place to look to create an item that has two states changed by an action?

Look under “Mechanical Marvels” on page 92. That has some information on devices.

–JA