I7: Best practices for limiting available actions for 1 turn

Sorry this is kind of a vague question. There’s a moment in my game where, for a single turn, there’s essentially one action the player can take that will result in success, and anything else will result in failure. The idea is that this is a moment that demands an immediate response, so I don’t want the player to be able to dawdle around examining things, listing their inventory, getting parser errors, or doing anything other than the correct solution. (That said, I do want to allow for a pretty broad range of synonyms for the successful action.)

So my question is what’s the best, least sloppy way to implement this? My first thought was to create a scene and then have some kind of “before doing anything while that scene is happening” rule, but I’m not sure if that will be completely effective… I haven’t tried it yet, but I suspect that parser errors and such will still take priority over that rule, so I’ll have to rearrange rule order and I don’t really know what I’m doing in that department, so I wanted to see if there was a better way. I feel like I see this sort of thing in games all the time, so it can’t be that difficult, right?

I came up with a couple of ways and wrote a demo using each one.

In this demo, you’re in a room with a bomb. When you jump, the bomb is set and you have 1 turn to type ‘sing’ to disarm it. Whether you disarm it or get blown up, you can keep playing and testing.

The first demo uses an event but will allow the player extra turns to type the right thing if they invoke parser errors. The second demo is more aggressive and will blow them up next turn if they do anything at all but type ‘sing’. The method I use in the 2nd demo may not be applicable if the command needed to get out of the sticky situation is very complicated or needs lots of variations, as it’s kind of raw. But you can see how these work and if they suit.

Method 1: (Allows another turn for parser errors.)

[code]“Dude Ranch Bomb” by Wade Clarke.

There is a room called Dude Ranch.

defuser is a number variable.

a bomb is a thing. it is in dude ranch. it is fixed in place.

When play begins:
say “HOW TO PLAY: Type JUMP to set off the bomb.”

Instead of jumping when defuser is 0:
the world ends in 1 turn from now;
say “Type SING right now to defuse the bomb, or you’ll die.”;
now defuser is 1.

At the time when the world ends:
if defuser is 1:
say “KABOOM! You died! Fortunately I have brought you back to life. JUMP again to reawaken the bomb.”;
now defuser is 0;
try looking.

Instead of singing:
say “La la la!”;
if defuser is 1:
now defuser is 0;
say “Your singing disarmed the bomb.”[/code]

Method 2: (doesn’t allow for parser errors)

[code]“Dude Ranch Bomb” by Wade Clarke.

There is a room called Dude Ranch.

defuser is a number variable.

a bomb is a thing. it is in dude ranch. it is fixed in place.

When play begins:
say “HOW TO PLAY: Type JUMP to set off the bomb.”

Instead of jumping when defuser is 0:
say “Type SING right now to defuse the bomb, or you’ll die.”;
now defuser is 1.

Instead of singing:
say “La la la!”;
if defuser is 1:
now defuser is 0;
say “Your singing disarmed the bomb.”

After reading a command:
if defuser is 1 and the player’s command does not match “sing”:
say “KABOOM! You died! Fortunately I have brought you back to life. JUMP again to reawaken the bomb.”;
now defuser is 0;
try looking;
reject the player’s command. [if we don’t reject the player’s command, whatever they did type will be tried right now.][/code]

  • Wade

If you don’t want to allow for parser errors, you just need to handle the explosion during the “printing a parser error” activity. You just need to make sure you “follow the shutdown rules” because the normal turn sequence won’t do it for you.

[code]There is a room called Dude Ranch.

defuser is a number variable.

a bomb is a thing. it is in dude ranch. it is fixed in place.

When play begins:
say “HOW TO PLAY: Type JUMP to set off the bomb.”

Instead of jumping when defuser is 0:
the world ends in 1 turn from now;
say “Type SING right now to defuse the bomb, or you’ll die.”;
now defuser is 1.

At the time when the world ends:
if defuser is 1, detonate.

To detonate:
say “KABOOM! You died!”;
end the story saying “You blew up.”

Instead of singing:
say “La la la!”;
if defuser is 1:
now defuser is 0;
say “Your singing disarmed the bomb.”

After printing a parser error when defuser is 1:
say conditional paragraph break;
detonate;
if the story has ended, follow the shutdown rules.
[/code]