我正在尝试使用inform 7编写一段互动小说,我想为播放器选择一个,我想要一个简单的是或否我使用了以下代码:
if the player consents say "You get a better view of the stranger."
Otherwise:
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub"
然后我收到这个无用的错误消息:
你写道'如果玩家同意说“你能更好地了解陌生人。”':但是我找不到一个我知道如何处理的动词。这看起来像是一个“if”短语,它已经滑落了它的系泊,所以我忽略了它。 ('如果'短语,像所有其他此类指令一样,属于规则或短语的定义 - 而不是没有上下文的句子。可能是意外使用句号或跳过的行而不是分号,这样你无意中结束了最后一个早点统治?)
非常感谢任何帮助。
答案 0 :(得分:2)
标点符号已关闭。短语应以分号结尾,如果短语应使用begin..end blocks或者"冒号和缩进"样式。所以:
if the player consents begin;
say "You get a better view of the stranger.";
otherwise;
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";
end if;
或
if the player consents:
say "You get a better view of the stranger.";
otherwise:
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";
请注意第二个示例中的冒号,分号和制表符。
此外,正如错误消息所示,您需要指定何时应该询问该问题。如果短语必须在规则或短语内。例如,如果问题应该由于某个操作而被提出:
After examining the stranger for the first time:
say "Move closer?";
if the player consents begin;
say "You get a better view of the stranger.";
otherwise;
say "You can't make out what's happening clearly, however, you notice the stranger walking out of the pub";
end if;