Die after X moves unless exited room?

I have a room, on fire, and if I don’t exit in less than 5 moves, I die.

How do I do that?

It’s the start room, so basically I want (I know this isn’t IF code):

If (room = “start room” and moves = 5) then end the game in death.

Thanks!

[code]The house is a room. “The house is on fire”.

The fire escape is a room. It is east of the house.

Every turn when the player is in the house:
At 9:05 AM: say “You burn to death”; end the game in death.[/code]

seems to trigger regardless of room :frowning:

I haven’t tested this, but if you’re working in Inform 7 then I think something like the following would work:

Every turn when turn count is 5:
If the location is Burning Room:
End the game in death.

Please note that the spaces in the above fragment would need to be changed to tab characters. This also assumes that there’s no way the player can return to the burning room; it only triggers on the fifth turn, so if it is possible to return to the room and the player actually does so after Turn 5, it would not trigger.

Robert Rothman

[Edit] Sorry, it looks like the spaces got dropped. The second line of the fragment should be indented one tab, and thrid line two tabs.

At 9:05 AM: [if the player is in the house] say "You burn to death"; [if the player is in the house] end the game in death.

doesn’t work either.

That’s the correct idea, but anything inside brackets are comments and ignored by the compiler except inside strings. Remove the brackets and you’re good.

At 9:05 AM: if the player is in the house: say "You burn to death"; end the game in death.
(Remeber to use tabs: one tab in front of the conditional and two tabs in front of the last two lines.)

Bingo!

Thanks!

Yes, I’m an idiot :slight_smile:

Thanks. Your example worked too.

This is how I addressed a timed event (and many more, but they trigger differently):

Before going north from the Molten Span: say "You walk over the crumbled wall, finding your way to the Construct pillar. The heat is almost unbearable."; the heat is unbearable in three turns from now. At the time when the heat is unbearable: if the player is in the Pillar section: say "The heat is too intense. You run back to the step above the molten span before you lose your senses."; now the player is in the Molten span.
The first “before” rule activates the counter. You can change it to something like “After : the heat is unbearable in 5 turns from now”.
The part “At the time when etc” triggers the event (in this case just leaving the room, you can change it to “end the game etc.”) and checks the location.
So: every time you enter the Pillar Section the counter is reset.

In this way, you dont have to wait for turn 5, 10, 15, 20 etc to run your event, but exactly the number of turns you want FROM NOW.

That’s helpful, thanks.

Since this was an event at the very start of the game, that level of complexity wasn’t important, but it’s still useful to know about.