如何在Inform7中显示可用的房间

时间:2017-02-12 00:04:34

标签: inform7

我正在进行Inform7中的第一次文本冒险,这让我发疯。

我定义了三个房间如下:

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"

因为很多人不熟悉玩这些游戏,所以他们对床和卫生间一无所知,因为游戏的开头就是:

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

我不想使用门,所以我需要让连接的房间对玩家可见。我该怎么办?

1 个答案:

答案 0 :(得分:4)

通常的解决方案是仅描述房间描述中的出口,例如Foon mentions in a comment。这样你就可以为散文添加一些颜色和变化,而不仅仅是直接列出内容。

一个简单的自动化解决方案是在房间描述之后打印房间出口列表(改编自文档中的示例102):

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."

更精确的方法是安装并包含Gavin Lambert的扩展程序Exit Lister(可在IDE的“扩展程序”窗格中的公共库中找到)。它处理记住玩家知道哪些房间,所以你会看到像#34;你可以从这里向北和向西走"当游戏开始时以及之后当玩家访问其他房间时,"你可以从北面进入浴室,然后向西进入厨房。"