How to trigger an event to occur x turns after another event?

+2 votes
57 views
asked Mar 31 in Authoring by verityvirtue (23 points)
recategorized Apr 1 by Alex

This is a noob question - sorry. I have these scenes triggered to begin when the NPC Sister has been in the Living room for seven turns.

Dinner is a scene. Dinner begins when Sister is in Living room for seven turns.

The compiler, however, refuses to compile this. Likewise, the compiler complains about this:

After entering room x for the first time:
say "Your mum calls out your name.";
move Sister to Living room in seven turns.

Could anyone point me to where I've gone wrong? Thank you!

1 Answer

+1 vote
answered Mar 31 by Ryan Veeder (290 points)
selected Mar 31 by verityvirtue
 
Best answer

In Inform 7 we can discuss future events only in a very restrained way. Your first problem is a minor wording issue; you need to say "Dinner begins when Sister is in Living Room for the seventh turn."

Your second problem requires a little bit more work. But only a little! From ยง9.11 in the documentation comes this example:

An egg-timer is in the Chamber. "A plastic egg timer in the shape of a chicken can be pressed to set it going."

Instead of pushing the egg-timer:
    say "It begins to mark time.";
    the egg-timer clucks in four turns from now.

At the time when the egg-timer clucks:
    say "Cluck! Cluck! Cluck! says the egg-timer."

So, we can say a specific rule will trigger after a certain number of turns. A little inconvenient, but all that we have to do is give the intended effect its own rule, with its own name:

After entering room x for the first time:
    say "Your mum calls out your name.";
    Sister shows up in seven turns from now.

At the time when Sister shows up:
    move Sister to Living Room.
commented Mar 31 by verityvirtue (23 points)
Oh okay, thank you!
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...