[I7] problem with an every turn rule

Hi there,

The Idea that I’m trying to implement doesn’t seem hard yet I can’t figure out one thing. The player starts on the ground, which has been created as a supporter, if he does not move (a compass direction) after six turns, the story ends with his death. After two turns, if the player has not moved, he gets a “warning”. Then after the fourth turn another warning comes then of course if the sixth turn doesn’t comes and no movement, the story ends.

The first problem: I can’t figure out how to make it so this rule doesn’t take effect till the player gets off the ground.
I’ve tried a lot of different things, the latest one was creating a scene, which didn’t work.

Here’s the code

[code]Sloth is a scene. Sloth begins when the player is not on the ground.

When Sloth begins:
every turn:
say “[turn-death]”

To say turn-death:
After not going for the sixth turn:
end the story saying “Your captor has decided to cut his losses and immediately cuts you down with a burst of fire from his rifle.***[paragraph break]*** YOU HAVE DIED!”
After not going for the fourth turn:
say “Your captor raises the rifle directly at you while yelling in his own language.”;
After not going for the second turn:
say “Your captor visibly grows increasingly more nervous and impatient.”[/code]
seems like no matter what I do, I can’t get Inform to wait till the player gets up.

The second problem: I want it to repeat the first warning, every turn, till the next warning … and so on but this is what I’m getting.

Any help would be much appreciated.
Thank you!

There’s a problem with your syntax.
Inform reads your code like this:

When Sloth begins: do nothing.

	Every turn:
		say "[turn-death]"

To say turn-death: do nothing.

	After not going for the sixth turn:
		end the story saying "Your captor has decided to cut his losses and immediately cuts you down with a burst of fire from his rifle.***[paragraph break]*** YOU HAVE DIED!"
		
	After not going for the fourth turn:
		say "Your captor raises the rifle directly at you while yelling in his own language."
		
	After not going for the second turn:
		say "Your captor visibly grows increasingly more nervous and impatient."

(Perhaps it would have been better, if it simply didn’t compile when the source text defines a rule that lacks a body.)

You want something like

The Clearing is a room.
Sloth is a scene. Sloth begins when the player was not on the ground.
The ground is scenery supporter in the Clearing. The player is on the ground.

Every turn while Sloth is happening:
	say "[turn-death]"

To say turn-death:
	if Sloth is happening for the sixth turn:
		end the story saying "Your captor has decided to cut his losses and immediately cuts you down with a burst of fire from his rifle.***[paragraph break]*** YOU HAVE DIED!";
	otherwise if Sloth is happening for at least the fourth turn:
		say "Your captor raises the rifle directly at you while yelling in his own language.";
	otherwise if Sloth is happening for at least the second turn:
		say "Your captor visibly grows increasingly more nervous and impatient."

This is actually an Inform bug.

Thanks, Felix! It worked like a charm. What a great lesson; that really made sense when you showed me how Inform is reading it. The syntax isn’t obvious at all to me, I never would have seen that. Thank you, I’m still learning bit by bit.

One question, if I could? Why is it “when the player was not on the ground”, and not “when the player is not on the ground”?

Yeah, I really do thing it would be better if maybe Inform didn’t compile. But I guess if it is a bug then it wasn’t meant to. When I compiled (with the bad syntax) I noticed a longer than normal pause at the beginning. Perhaps it was a byproduct of the offending code? You guys are like Inform Ninjas :wink:

You can use “when the player IS not on the ground”, it might even be exactly what you want!

The difference is that if sloth starts when the player IS not on the ground, then the first turn of that scene will be the one when you “get off the ground”, and the message about your captor getting impatient will appear the first thing you do anything but start walking.

If sloth starts when the player WAS not on the ground (viz. at the beginning of the turn, i.e. if he had already risen before he did anything this turn), the first turn of the Sloth Scene will be the one after you “get off ground”, and the captor won’t get impatient until you have tarried a second turn.

Try both wordings, and choose the one that suits the game.