Wait for the SPACE key

I have looked for a way to achieve what I want and have found some similar things. But, it doesn’t quite work the way I want it to.

This is what I want to achieve:

(1) I want the player to be presented with text, like so:

When Event begins:
say “This.”;
wait for the SPACE key;
say “[line break]This.”;
wait for the SPACE key;
say “[line break]This.”;

It doesn’t work beyond the two first paragraphs and I don’t know why. I also want to be able to have many line breaks, i.e. many paragraphs in a single say.

(2) I want the player to be presented with a message like “Hit space to continue.”

(3) Then finally I want the player to arrive in a room. I think you say something like move player to, but I’d like to see it incorporated with the other things.

I would also be interested to know more about events, how to give the player options to choose from, and how to use player input etc.

Thank you for your time.

If you include Emily Short’s Basic screen effects extension, it works like a charm. Like this:

Include basic screen effects by Emily Short.

Lab is a room.

The hat is here.
 
Lab2 is a room.



When play begins:
	say "Thing 1.";
	pause the game;
	say "Thing 2";
	pause the game;
	say "Thing 3";
	pause the game;
	say "Thing 4";
	pause the game;
	move player to lab.
	
Check taking the hat:
	say "Thing 1.";
	pause the game;
	say "Thing 2";
	pause the game;
	say "Thing 3";
	pause the game;
	say "Thing 4";
	move the player to Lab2;
    continue the action (unless you want to stop the action or have something else happen).
	

Does this help?
As to events and options, you’d have to be more specific about what events and options you’re interested in learning about.

6 Likes

Thank you, it worked the way I envisioned.

I have a couple of questions regarding how to set off the dominoes of text.

Could you make it work if you talked to an NPC? Can you check for any action to set it off?

How do you do if you want it to be initiated when the player enters a room?

I figure you could make it work with a scene like I’ve read about, but it doesn’t seem like that’s always necessary if everything you’re attempting to do is display a sequence of text and then drop the player off somewhere else (or keep them where they are).

Also, do you know if it’s possible to change the text displayed – the “Please press SPACE to continue.” part? I might want to change it to just “Press SPACE to continue.” if it’s possible.

1 Like

You can edit the extension - in Section - Waiting for key-presses, quitting suddenly change the relevant text to whatever you want:

For pausing the game (this is the standard pausing the game rule):
	say "[paragraph break]Please press SPACE to continue." (A);
	wait for the SPACE key;
	clear the screen.

Basic Screen Effects has several options.

wait for any key prints nothing and waits for any key.

wait for the space key prints nothing and waits for the space key in particular, ignoring all other keys.

pause the game, like Hanon quoted above, prints its message, waits for a space, and clears the screen.

If you wanted a custom message, an easy thing would be writing your own phrase:

To pause:
  say "I'm just going to sit here until you press a key, any key [command prompt] ";
  wait for any key.

(I like to include the command prompt to emphasize to the player that we’re waiting for input.) Or if you wanted to do it with a bunch of different messages at different points, you might go with:

To pause saying (sv - a sayable value):
  say "[sv] [command prompt] ";
  wait for any key.;
  say line break;

Or if you’re ok with accepting any key and clearing the screen, you could use pause the game and change its message with:

The standard pausing the game rule response (A) is "Press a key. Any key."

pause the game is a phrase. You can put a phrase into any rule, or in another to-phrase you define. So the question comes down to exactly where you want to do that.

For entering a room that might be:

Last report going: wait for the space key.

As to talking to an NPC, that’d depend on how you wrote the code for that.

1 Like