当玩家角色进入他们所居住的孤儿院/寄宿学校的教职员工时,说玩家有两个回合才听到经理的脚步声从大厅走下来,他们被催促隐藏。我通过使用数字变量完成了这项工作。在这一点上,我有另一个数字变量(通过仅使用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自己的时间系统来解决这个问题。我试过了,这是一个比现在更大的问题。
答案 0 :(得分: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!";
(此外,如果您提供完整的源代码,或者至少是所有相关内容,将会有所帮助。这次您遗漏了员工室和橱柜。)
答案 1 :(得分:1)
您可以在进入房间后指定一个动作及其出现时间:
After going to Staffroom for the first time:
manager comes in three turns from now.
At the time when manager comes:
YOUR STUFF