A way to ignore remainder of "When Play Begins..." rules?

I’m working on a tutorial extension which adds a separate mini-game which is separate from the author’s game.

Everything works fine, but if the player selects the tutorial, I need the parser to discard the remainder of the “when play begins…” rules so none of the author’s setup (such as adding stats to the player, or displaying a post-banner graphic) will run.

Essentially I’d like it to behave like “stop the action” for the entire “when play begins” rulebook.

If your whole when play begins rulebook is in one rule, all you should need is an if-test. If it’s spread out all over everywhere, you’ll need the advice of an expert…

You can just cut the When play begins rulebook off with a “rule succeeds,” like this:

[code]Actual First Room is a room. Minigame room is a room.

When play begins:
say “Starting the real game now! Whoop whoop!”

First when play begins:
say “Would you like a tutorial?”;
if the player consents:
move the player to Minigame room, without printing a room description;
rule succeeds.[/code]

Now the problem is, how do you get the When play begins rules to run when the player starts the real game? I guess you could set a flag and call them by hand:

[code]Actual First Room is a room. Minigame room is a room. “Jump now.”

When play begins:
say “Starting the real game now! Whoop whoop!”

Tutorial taken is a truth state that varies.

First when play begins when tutorial taken is false:
say “Would you like a tutorial?”;
if the player consents:
move the player to Minigame room, without printing a room description;
rule succeeds.

After jumping in Minigame room:
now tutorial taken is true;
follow the when play begins rules;
move the player to actual first room.[/code]

though note that this won’t print the banner or do an initial “look” for you (here the room heading gets printed when you move the player to the first room). Might want to look into how to do that more cleanly.

I think that WORKED…Matt W!!!11 (Kermit arms aaaAAAAAAYYYYY)

I didn’t know you could could escape all the rules with a “rule succeeds”. I thought it would go to every rule listed!

Yeah, according to section 19.11 of Writing with Inform “rule succeeds” (or fails) stops the whole rulebook unless it’s a rulebook like “Every turn” that never produces an outcome. Why does it work in “When play begins” but not “Every turn”? I don’t know.

…in fact, on a little checking, I think section 19.11 is wrong and “rule succeeds” halts the Every Turn rulebook. Mantis ho! (Or maybe it’s not meant to work in “Every turn” and “When play begins” rules, in which case this solution will not be long for this world.)

It’s possible that the manual tries to say that you shouldn’t stop rulebooks like every turn rules, not that it’s impossible, but even then it’s worth a ticket to have the wording clarified.

Yes, and now I remember that there was a problem with one of the examples using “rule succeeds” to stop an Every Turn rule and thus breaking the rest of the Every Turn rules. So the documentation is probably saying something like “The every turn rulebook doesn’t have outcomes, so it doesn’t matter whether you mark it as a success or a failure, it’ll just stop the rulebook.” But it’s far from clear.

Anyhow I filed the bug.

So…is using “rule succeeds” during “when play begins” to stop the remainder of the rules not supposed to happen?

Do I need another solution, or are you talking just about “every turn” rules?

It seems like intended behavior; it’s how it acts for other rulebooks. The documentation is just unclear.