Hi, I just wanted to add a note about Playfic (though this might be a needless complication); Playfic uses the 6G60 version of Inform, which is a few years old. If you want to use the latest version of Inform online, there’s a new site called Borogove which has the 6M62 version, which is a couple of years more recent than 6G60 and has some relatively big new features (in particular, a way of making it easier to change default messages). There’s a thread on it here. It would also make it easier for you to use extensions if you want.
As for the scene change machinery getting stuck… one thing I thought of was using past tense as documented in §9.13 of the documentation. If you say “If X was Y” that checks whether “X was Y” was true at the beginning of the most recent action. So if you say “…when P1 was happening” that will check whether P1 was happening at the beginning of the turn. You can make that change to P2, and when the scene change machinery checks “…when P2 was happening” that won’t be true, so you get to stay on P2 instead of going into a loop.
Here’s a short example:
P1 is a recurring scene. P1 begins when play begins. P1 ends happily when P1 was happening and the location is not Dead. P1 ends tragically when P1 was happening and the location is Dead.
P2 is a recurring scene. P2 begins when P1 ends happily. P2 ends happily when P2 was happening and the location is not Dead. P2 ends tragically when P2 was happening and the location is Dead.
P3 is a recurring scene. P3 begins when P2 ends happily. P3 ends happily when P3 was happening and the location is not Dead. P3 ends tragically when P3 was happening and the location is Dead.
P1 begins when P3 ends happily.
When P1 ends tragically:
say "P1 carked it.";
end the story.
When P2 ends tragically:
say "P2 carked it.";
end the story.
When P3 ends tragically:
say "P3 carked it.";
end the story.
When P1 begins:
say "Starting P1."
When P2 begins:
say "Starting P2."
When P3 begins:
say "Starting P3."
Lab is a room. Dead is north of Lab.
This particular solution only would work for scenes that change every turn, but it sounds like that’s what you want!