Possible to detect if REPLAY is happening?

My game has “story pauses”, where a decorative line is printed and I wait for a keypress to continue.

Unfortunately, this breaks REPLAY in Frotz — It doesn’t continue with replaying after this point. It works in two other interpreters; they seem to continue without worrying about a keypress.

Is it possible to either:

  • wait for a keypress in a way that doesn’t cause this problem?
  • detect if REPLAY is happening, so I can not wait for a keypress
  • trigger a natural “[More]” bit , rather than my waiting for a keypress?

Thanks for any ideas!

(If it helps, I’m waiting for a keystroke with “@read_char 1 → key;”)

Basic Screen Effects (an extension that, I believe, comes bundled with Inform).

To produce a pause until the player types any key:

wait for any key.

To produce a pause until the player types SPACE, ignoring all other keys:

wait for the SPACE key.

To give the player a message saying to press SPACE to continue, wait for a keypress, and then clear the screen before continuing the action:

pause the game.

In extreme cases, we may want to end the game without allowing the player an opportunity to RESTART, RESTORE, or QUIT; to this end:

stop game abruptly.

1 Like

Alas, I’m doing this in Inform6 — but I can dig into the source for that to see if they’re doing something different than @read_char .

Oops, looks like you’ve mislabeled your post. I’ve moved it to the Inform 6 category—hopefully someone can help.

1 Like

PunyInform sets a global xcommsdir to 1 when recording, 2 when replaying, 0 any other time. So if you’re using the built-in REPLAY command rather than some special feature of Frotz, you can check that global and take line input instead of key input for your pauses. (Or just skip them entirely.)

1 Like

Thanks, all!