[I7] Every Turn Rule Problem

I have a situation in my game similar to this rather contrived example:

"Columbo" by "J. J. Guest"

Patrick McGoohan's office is a room. The corridor is a room. The office door is a closed door. It is inside from the corridor and outside from Patrick McGoohan's office.

Lieutenant Columbo is a man in the corridor.

Knocking is a scene. Knocking begins when play begins. Knocking ends when Accusation begins.

Every turn during knocking, say "There is a knock at the door."

After opening the door:
	now Lieutenant Columbo is in Patrick McGoohan's office;
	say "You open the door, and Lieutenant Columbo walks back into the room."
		
When Knocking begins:
	The Lieutenant enters in two turns from now.
	
At the time when the Lieutenant enters:
	if Lieutenant Columbo is in the corridor:
		now Lieutenant Columbo is in Patrick McGoohan's office;
		say "Lieutenant Columbo opens the door and walks back into the room."
		
Accusation is a scene.

Accusation begins when Lieutenant Columbo is in Patrick McGoohan's office.

Every turn during Accusation, say "[one of]'Sorry to bother you, Mr McGoohan,' says Lieutenant Columbo, 'but there's just one more thing...'[or]'This piece of cheese carries the perfect impression of your teeth, proving that you were at the scene of the crime.' continues Columbo.[or]'You're under arrest, Mr McGoohan.' says Columbo.[stopping]"

The problem is that the every turn rule in the scene Accusation runs immediately if you open the door yourself, but one turn later if Columbo lets himself in:

Columbo
An Interactive Fiction by J. J. Guest
Release 1 / Serial number 190729 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Patrick McGoohan's office
You can see an office door here.

>open door
You open the door, and Lieutenant Columbo walks back into the room.

"Sorry to bother you, Mr McGoohan," says Lieutenant Columbo, "but there's just one more thing..."

>undo
Patrick McGoohan's office
[Previous turn undone.]

>z
Time passes.

There is a knock at the door.

>z
Time passes.

There is a knock at the door.

>z
Time passes.

There is a knock at the door.

Lieutenant Columbo opens the door and walks back into the room.

>z
Time passes.

"Sorry to bother you, Mr McGoohan," says Lieutenant Columbo, "but there's just one more thing..."

I’m not sure why this should be, but presumably it something to do with the point at which the every turn stage rule is triggered. My preferred behaviour would be that Columbo speaks the line the moment he steps into the room.

I notice also that the every turn rule that runs during the scene Knocking also fires on the second turn, rather than the first. Does anyone have any suggestions?

Scene changes happen after the every-turn rules, that’s true. It’s possible to rearrange this, but I don’t recommend it. It would cause other problems.

(Specifically, rearranging those rules would give you a game in which a “Scene starts when…” couldn’t react immediately to any state change in an “every turn” rule.)

The easiest way to get what you want is to write a separate “When Accusation begins” rule that prints the same message. You could define a phrase to print that text if you didn’t want to repeat the typing. (Or you could have Columbo say something slightly different the first turn, which might improve the flow of the conversation.)

1 Like

Thanks Zarf. I had tried putting the first line into a “When Accusation begins” rule, but that led to Columbo delivering two lines in the same turn when the player opened the door. I really wanted to avoid adding another line to what was already a three-turns-long expository speech.

I solved the problem by creating a one-turn-long scene that delays the delivery of the Columbo’s second line if the player opens the door. It’s a bit hacky, but it works.