inform7

How do I show the available Rooms in Inform7


I'm working on my first text adventure in Inform7 and it drives me crazy.

I defined three rooms as following:

The house is a region. 
The bedroom and the bathroom and the kitchen are in the house.
The bathroom is north of the bedroom.
The kitchen is west of the bedroom.
The bed is a supporter in the bedroom.

Bedroom is a room. It is neuter. "It is pretty cold in here"

Because a lot of people are not familiar with playing these games, they won't know anything about the bed- and bathroom, because the game starts with that:

Bedroom
It is pretty cold in here.
You see a bed.

I don't want to use doors so I need to make the connected rooms visible for the player. How should I do that?


Solution

  • The usual solution is to just describe the exits in the room description, like Foon mentions in a comment. That way you can also add some color and variation to the prose instead of just straight up listing things.

    A simple automated solution is to print a list of room exits after the room description (adapted from example 102 in the documentation):

    Definition: a direction (called thataway) is viable if the room 
      thataway from the location is a room.
    
    After looking:
        say "You can go [list of viable directions] from here."
    

    A more refined method is to install and include the extension Exit Lister by Gavin Lambert (found in the Public Library in the IDE's Extensions pane). It handles remembering which rooms are known to the player, so you'll see something like "You can go north and west from here" when the game begins and later when the player has visited the other rooms, "You can go north to the bathroom and west to the kitchen from here."