"when a scene ends" runs twice

It seems that if a scene has multiple endings, a generic “when a scene ends” rule runs twice:

[code]Swapped is a scene. Storage is a container.

When swapped begins: now everything held by the player is in storage.

Swapped begins when play begins. Swapped ends musically when singing. Swapped ends bouncily when jumping.

When a scene ends:
Now everything held by the player is off-stage;
Now everything in storage is carried by the player.

Test is a room. The player holds a ball. There is a rock in Test.

test me with “i/get rock/scenes/rules/sing/i”[/code]
What’s the sense in that? How can I avoid doing things twice that should only be done once?

Looks like a bug – it doesn’t happen if you specifically have “When Swapped ends”. [edited]

I’d try taking care of this with a flag (the way I do everything):

[code]Swapped is a scene. Storage is a container.

When swapped begins: now everything held by the player is in storage.

Swapped begins when play begins. Swapped ends musically when singing. Swapped ends bouncily when jumping.

A scene can be unended or ended. A scene is usually unended.
When a scene (called knee play) begins: now knee play is unended.

When a scene (called Knee Play) ends:
if knee play is unended:
now knee play is ended;
Now everything held by the player is off-stage;
Now everything in storage is carried by the player;
say “boop!”.

Test is a room. The player holds a ball. There is a rock in Test.

test me with “i/get rock/scenes/rules/sing/i”[/code]

boop! added for testing purposes.

Are you saying that the “when a scene ends” rule runs whenever the conditions for ending the scene are satisfied, even if the scene itself is not running (because it already ended by virtue of an alternate set of conditions being satisfied)? I thought that the “when a scene ends” rule only runs if (a) the scene itself is running, and (b) the conditions for ending it are satisfied. Or are you only talking about the case where both sets of ending conditions become satisfied on the same turn?

Robert Rothman

No, that doesn’t happen in this example. What happens is that when the scene ends, the rule runs twice. It looks like a bug to me too.

I went ahead and reported it.

inform7.com/mantis/view.php?id=856