Is there a way to have two descriptions for a room?

I’m trying to make an IF game where when the player first goes into a room, the description is about the player seeing the room for the first time. But when they “look”, they’re supposed to see a regular description. Is there any way to do this?

Example 4 in the Inform 7 documentation is pretty close to what you want. It uses the “unvisited/visited” property that every room has. A room is unvisited until the player sees its description for the first time (i.e. until the player goes there); then it becomes visited. You can use that to print something different after the player visits the room for the first time.

Try something like this:

The Ballroom is a room.

Description of the Ballroom is "[if unvisited]This text shows up the first time the room is seen.[otherwise]This text shows up the rest of the time.[end if]".
2 Likes

Thanks, it worked perfectly. I accidentally overlooked that part in the documentation.

No worries, glad it helped :slight_smile: The Inform 7 documentation is not that well laid out, and it’s very easy to miss things. (In fact, I can’t even find the visited/unvisited property listed in the general index!)

1 Like

? You should find it both under the section describing rooms in the Kinds index and in the Lexicon

You’re right, that’s an error in the manual.

What is? Visited/unvisited is listed in both these places in my IDE documentation (Windows 18th Nov 2020 6M62, and my previous version Feb 23rd 2018 6M62)

Ah, I was talking about the general index under the Documentation tab, not the main Index tab. Although I should have checked there as well - apologies!

Ah yes, you’re right of course :slight_smile: