Inform 7: Can I hide names of things from user?

Suppose I have an object named gothic window 1 but it has been given a printed name “gothic window”. Can I prevent inform 7 from recognizing “gothic window 1” as the name of the towel?

I have several unique scenery objects with the same name. The easiest way for me to deal with them is to give them unique identifiers and then to refer to them by this name, but doing so lets the player also interact with the object using this name, which I don’t want.

I have multiple objects with the same name. They are all background stuff. Cannot be moved.

These are referred to by internal names such as “gothic window 1” “gothic window 2” etc. etc.

Can I prevent the player from interacting with these names? That is: Can I make it so that inform 7 ignores attempts at interacting with this name?

Specifically: I’m using these names only internally while developing. The actual name is the printed name which is identical for all the window objects (“gothic window”).

I know there is a solution with using backdrop, but backdrop objects have another problem in that ONE Of the windows can be interacted with (it can be opened), the others cannot. (they are out of reach).

Edit: Terribly sorry, moderators! I accidentally double posted threads since I’m not used to forums where threads have to be approved. I simply thought the first thread had gone missing somehow by a bug.

You can use the privately-named property for this:

Gothic window 1 is privately-named. Understand "gothic" and "window" as gothic window 1.

But it’s generally not worth doing this. If the player accidentally discovers the internal names of your objects, is that really a problem?

Personally I would make “gothic window” a kind.

A gothic window is a kind of thing.

There is a gothic window in the vestry. 
(etc...)

Then rather than giving the windows individual names in the code, I’d differentiate them by their locations; so you can write rules such as

Instead of doing something with a gothic window when the action requires a touchable noun and the location is not the chapel:
     say "The window is much too high to reach."

(Then you can write separate rules for the window in the chapel, which you could implement as an instance of the gothic window kind, or as something else, such as a door, depending on what it’s needed for.)

That solution with kinds is pretty cool. I thought it might be possible somehow to do something similar, but I wasn’t sure exactly how! Thanks for the help :slight_smile:

Yep that turned out to work pretty well, though I have another issue now.

(i figured rather than make a new thread I’d update this one)

So I have made the window into a container because that allows me to open it. I could make it a door, but this door does not connect to an actual area that you can visit.

But because the window cannot be both a container and a backdrop, the window is listed among items in the scene. Can I somehow hide it? (i can’t seem to make it into a backdrop seeing that it already is a container)

You don’t need to make the window a container in order to have it be openable. It takes a little work to do this, because you have to explicitly tell Inform that a gothic window can be open and openable and then make them all openable, but:

A gothic window is a kind of thing. A gothic window can be openable. A gothic window is always openable. A gothic window can be open.

Also, if you don’t want the gothic windows to show up in the room description, you can make them “scenery” rather than making them backdrops–backdrops are meant to be objects that can be in more than one room at once (in a way), like the sky or something.

So:

[code]A gothic window is a kind of thing. A gothic window can be openable. A gothic window is always openable. A gothic window can be open. A gothic window is always scenery.

The vestry is a room. “The vestry, with a beautiful gothic window.” There is a gothic window in the vestry.

The nave is north of the vestry. “The nave, with another gothic window.” There is a gothic window in the nave.

After looking when an open gothic window is in the location: say “A breeze blows through the open window.”[/code]

And you could write rules to block opening the windows that are out of reach. (You probably want to make them openable, or “open window” will result in “It isn’t something you can open,” which would be odd–a rule that says “It’s too high” makes more sense.)

Just an addendum to your solution, by stating that they are always openable and scenery you are not allowed to overwrite these properties for individual windows. My personal preference is therefore to always use ‘usually’ instead of ‘always’ - it still sets the default behavior but it can be overridden if ever needed.

That’s very interesting. The reason I wanted to make it a container in order for it to be openable was because a friend of mine (who’s much more into IF than I am) suggested that this would ultimately make it easier to handle the case of a player every deciding to place an object in the window.

Hmm. In this case, it depends on the behavior you want. If you want normal container behavior–you can put something in the window when the window is open, the thing stays in the window, like that–then you can make the window a container, and it won’t make a difference that windows aren’t “really” containers in some sense.

But if you want to give the player a polite refusal for putting things in the window, or have some other effect, you don’t actually need to make it a container–you can just write an “Instead of inserting something into the window” rule. For instance:

[code]A gothic window is a kind of thing. A gothic window can be openable. A gothic window can be open. A gothic window is always scenery.

The vestry is a room. “The vestry, with a beautiful gothic window.” There is an openable gothic window in the vestry.

The nave is north of the vestry. “The nave, with another gothic window.” There is a gothic window in the nave.

After looking when an open gothic window is in the location: say “A breeze blows through the open window.”

The player carries a paper bird.

Some tape is in the nave.

Instead of inserting something into a gothic window: say “You can’t put that in the window.”
Instead of inserting the paper bird into a gothic window: say “You’ll need some tape.”
Instead of inserting the paper bird into a gothic window (called pane) when the player holds the tape:
if the pane is open:
say “(first closing [the pane])[command clarification break]”;
try silently closing the pane;
if the pane is not closed, stop the action;
say “You tape the bird to [the pane].”;
now the paper bird is part of the pane.[/code]

Note that here putting the bird in the window requires the window to be closed, not open! It all depends on what you want to do.