通知 7:在一个事件中只应该在一个地方发生的事情现在每次玩家输入命令时都会发生

  • 本文关键字:一个 玩家 命令 方发生 事件 通知 inform7
  • 更新时间 :
  • 英文 :


当玩家角色进入他们居住的孤儿院/寄宿学校的职员室时,该玩家有两圈时间,然后听到经理的脚步声从大厅里下来,他们被敦促躲起来。我通过使用数字变量来做到这一点。在这一点上,我有另一个数字变量(仅使用 0 和 1 设置得像真/假的东西)来控制是否尝试做任何事情,除了"隐藏"或"错误地隐藏"给出响应"没有时间,只是隐藏!问题是:每当我开始游戏时,任何动作都会被拒绝,并遇到"没有时间,躲起来吧!

法典:

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自己的时间系统来解决这个问题。我试过了,这是一个比这更大的问题。

我认为问题在于你过于依赖每个回合规则,但它们在处理完所有动作后运行,所以现在他们做你想做的事也为时已晚。我还将隐藏定义为进入的同义词,因为该操作已经存在,并且是您想要发生的。所以试试这个:

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!";

(将来如果您提供完整的源代码,或者至少提供所有相关的代码,这将有所帮助。这次你省略了员工室和橱柜。

您可以指定进入房间后的操作及其出现时间:

After going to Staffroom for the first time:
     manager comes in three turns from now.
At the time when manager comes:
     YOUR STUFF

相关内容

  • 没有找到相关文章

最新更新