2016-03-06 27 views
0

我試圖用通知7編寫一段交互式小說,我想在播放器中放置一個選項,我想要一個簡單的是或否我使用下面的代碼:通知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" 

然後我得到這個無用的錯誤消息:

你寫「如果玩家同意說:‘你得到陌生人的更好的視野。’」但我不能找到一個動詞,我知道如何處理。這看起來像是一個'如果'的詞組已經滑落,所以我忽略了它。 (如果所有其他這樣的指令都是'如果'短語屬於規則或短語的定義 - 不是沒有上下文的句子,也許是句號或跳過的線被意外地用來代替分號,這樣你無意中結束了最後一個規則早?)

任何幫助將不勝感激。

回答

2

標點已關閉。短語應以分號結尾,短語應使用begin..end塊或「冒號和縮進」樣式。因此,要麼:

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; 
+0

謝謝你的回答,正是我想要的。 –