0

プレイヤー キャラクターが孤児院/寄宿学校の職員室に入ると、2 ターン後にマネージャーの足音がホールを下って来るのが聞こえ、隠れるように促されます。数値変数を使用してこれを行いました。この時点で、別の数値変数 (0 と 1 のみを使用して true/false のように設定) を使用して、「隠す」または「間違って隠す」以外のことをしようとするかどうかを管理し、「時間がない」という応答を返します。それ、ただ隠れてください!問題はこれです: ゲームを開始するたびに、すべてのアクションが拒否され、「その時間はありません。ただ隠れてください!」というメッセージが表示されます。

コード:

NOTSITS is a number variable.

When play begins:
    now NOTSITS is 0.

Every turn when the location is the Staffroom:
    increase NOTSITS by 1.

Every turn when the location is the Staffroom:
    if NOTSITS is 2:
        now HYF is 1;
        say "From the hall outside, you hear footsteps... Shit, that sounds like Rodger![paragraph break]HIDE!".

HYF is a number variable.

When play begins:
    now HYF is 0.

Every turn :
    if HYF is 1:
        instead of doing anything other than hiding or hiding wrongly:
            say "There's no time for that, just hide!".

Hiding is an action applying to nothing.
Understand "hide" as hiding.
Hiding wrongly is an action applying to one thing.
Understand "hide in [something]" as hiding wrongly.
Instead of hiding:
    try entering the empty cupboard;
    now HYF is 0.
Instead of hiding wrongly, say "Don't waste time with stupidity, just hide!"

これを解決するために Inform 7 独自の時間システムを使用することはお勧めしません。私はそれを試してみましたが、これまでよりもはるかに大きな問題の嵐でした.

4

2 に答える 2

1

問題は、毎ターンのルールに頼りすぎていることだと思いますが、それらはアクションがすべて処理された後に実行されるため、あなたが望むことを行うには遅すぎます. また、隠れるということは、入ることと同義であると定義しました。なぜなら、そのアクションはすでに存在しており、それはあなたが望んでいることだからです。代わりにこれを試してください:

First turn is a truth state variable. First turn is true.

The staffroom is a room.
In the staffroom is an enterable container called the empty cupboard.

Understand "hide" as entering.
Carry out entering when first turn is true:
    now first turn is false;

Understand "hide in [something]" as a mistake ("Don't waste time with stupidity, just hide!").

Instead of doing something other than looking or entering when first turn is true:
    say "There's no time for that, just hide!";

(また、将来的には、完全なソース コード、または少なくとも関連するすべてのコードを提供していただけると助かります。今回は、職員室と食器棚を省略しました。)

于 2013-12-24T00:51:04.647 に答える