使用 If player consents 通知 7 错误
Inform 7 error using If player consents
我正在尝试使用 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 the player consents say "You get a better view of the stranger."' : 但我找不到一个我知道如何处理的动词。这看起来像是一个失灵的 'if' 短语,所以我忽略了它。 ('If' 短语,像所有其他此类指令一样,属于规则或短语的定义 - 而不是没有上下文的句子。可能不小心使用了句号或跳过的行而不是分号,因此您无意中结束了最后一条规则早?)
如有任何帮助,我们将不胜感激。
标点符号已关闭。短语应以分号结尾,如果短语应使用 begin..end 块或 "colon-and-indentation" 样式。所以要么:
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;
我正在尝试使用 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 the player consents say "You get a better view of the stranger."' : 但我找不到一个我知道如何处理的动词。这看起来像是一个失灵的 'if' 短语,所以我忽略了它。 ('If' 短语,像所有其他此类指令一样,属于规则或短语的定义 - 而不是没有上下文的句子。可能不小心使用了句号或跳过的行而不是分号,因此您无意中结束了最后一条规则早?)
如有任何帮助,我们将不胜感激。
标点符号已关闭。短语应以分号结尾,如果短语应使用 begin..end 块或 "colon-and-indentation" 样式。所以要么:
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;