2017-02-14 4 views
0

私はInform7に電話を実装しています。Inform7のネストされた条件について

Calling is an action applying to one topic. 
Understand "Call [text]" or "[text] call" as calling. 
Carry out Calling: 
    if the topic understood matches "Melissa": 
     say "You are calling Melissa … 'are you fine?'"; 
     if player consents: 
      say "good???"; 
     otherwise: 
      say "I see!"; 
    if the topic understood matches "Dad": 
     say "Hey boy"; 
    otherwise: 
     say "beeeeep – [the topic understood] is not answering"; 

私がお父さんに電話すると、この手順が有効になります。私はメリッサを呼び出す場合でも、彼女は質問に答えるされたときにプレーヤーの同意、全体の手順は失敗します。あなたが

if A 
    ... 
if B 
    ... 
otherwise 
    ... 

そして、このような構成を持っている場合

>call melissa 
You are calling Melissa … 'are you fine?' 
yes 
good??? 
beeeep - 
*** Run-time problem P39: Attempt to say a snippet value which is currently invalid: words 2 to 2. 

    is not answering 
> 
+0

する必要がありますが、問題を@khelwood彼は条件「メリッサ」はあっても、「それ以外の場合は」最後に実行されていること、のようです一致した... – 18zehn

+0

それは確かに事実です。あなたがそれを望んでいなければ、あなたの '話題が理解するならば、「お父さん」は'あれば 'そうでなければ...' – khelwood

答えて

2

otherwiseブロックがいずれかで実行されますBが一致しなかった場合。一方

あなたは

if A 
    ... 
otherwise if B 
    ... 
otherwise 
    ... 

を持っている場合、どちらABがマッチした場合、otherwiseブロックが実行されます。

だからあなたの場合には、お使いの

if the topic understood matches "Dad": 

otherwise if the topic understood matches "Dad": 
+0

それです!どうもありがとう! – 18zehn

関連する問題