Giving the player two turns to do something

There is a point in my game where a dangerous NPC is about to enter the player’s location - this is flagged to the player. I want the player to have two turns to prepare before the NPC enters. I don’t know the syntax for wait two turns then move NPC to location x.

The rest I can handle with ‘every turn if the location of NPC is the location of the player’ and then set conditionals on that.

Misread your post, sorry. Let’s try that again.

You use a timer as the basic mechanism. The syntax for the timer is:

The time when Dangerous Arrival occurs is two turns from now. (This sets a timer called “Dangerous Arrival occurs”. You can call the timer whatever you like, of course.)

Personally, I’d use a scene to set it in motion:

Preparation Time is a scene. Preparation time begins when the player is in the Arena.*
When Preparation time begins:
(tab)The time when Dangerous Arrival occurs in two turns from now;

When Dangerous Arrival occurs:
(tab) now the Perfidious Agent is in the Arena;**

* obviously this can be any test you like: e.g. “when the player has taken the Brooch of Doom”

** or “now the Perfidious Agent is in the location of the player” if you don’t want the player to escape!

Hopefully this answer is more helpful now I’ve actually read your question! (Duh!)

1 Like

Thanks for this, the timing makes sense, I think I also need to spend some time properly learning how scenes work.

It’s not liking the ‘when’ in ‘the time when dangerous arrival occurs is two turns from now’, I can change it to ‘the time dangerous arrival occurs is two turns from now’ which complies, but how do I state what should happen when it occurs without using ‘When dangerous arrival occurs’?

I have tried the following to get rid of ‘when’ errors,

Preparation Time is a scene. Preparation time begins when coldtap is switched off or hottap is switched off.

When Preparation time begins:
The time when Dangerous Arrival occurs is two turns from now.

Move giant to the location of the player when Dangerous Arrival occurs.

Which returns error:

n the sentence ‘Move giant to the location of the player when Dangerous Arrival occurs’ , I can’t find a verb that I know how to deal with.

See the manual: 2.1 > 2.1. Creating the world

Because of this problem, the source could not be translated into a working game. (Correct the source text to remove the difficulty and click on Go once again.)

Dangerous Arrival begins when Preparation Time has been happening for exactly two turns.

Preparation Time ends when Dangerous Arrival begins.

When Dangerous Arrival begins:
     say "The giant stomps his way to your location!";
     now giant is in the location.
1 Like

thanks! That works, and I should be able to build the rest of what I need from that.

For what it’s worth, the problem with the original “Dangerous Arrival” syntax is that the “at the time when” needs to go in the other phrase–the phrase that triggers the event rather than the phrase that sets it.

So you could say:

When Preparation Time begins: Dangerous Arrival Occurs in two turns from now.

At the time when Dangerous Arrival Occurs: now the Perfidious Agent is in the location.

See §9.11 of Writing with Inform. “Occurs” isn’t a special word, it’s just part of the name–you could use any verb you want (or no verb, though that would make it harder to read). “At” is the key word here–it has to be followed either by a time (“At 4:35 PM”) or “the time when [named event you set up earlier]”.

Marshall’s solution is probably better, though, because it ties the different scenes and the arrival together nicely!

3 Likes