Placement of messages


Just a brief question:

How can I place messages I print with “Say” at the end of everything. I want to use this for printing little Tutorial messages to the screen, best at the end of all descriptions.

Is there a way to control the placement of messages?


“Before reading a command” is a good place to do this kind of message, because it happens after everything else has been printed and just before the command prompt. This, for instance, will print its nonsense every turn:

Foo is a room. Before reading a command: say "Blargh."

You can then add conditions to the before reading a command rule to decide whether it should print tutorial text, and if so, what.


I didn’t know about the “Before reading a command” rule. Unfortunately it prints its message at the beginning of the game (before the first command of the game), yet I want to print a message at the end of regular text output of a command a user has input.

Am I overlooking something?


Well, the end of one turn is just before the beginning of the next. :slight_smile: You want to add some conditions to this to make it only fire when you want it to (e.g., the turn count is greater than 1, or whatever).

It would also be possible to manually add another rule to the turn sequence rules that would fire only at the actual end of the turn sequence, but it’s probably less work to use the existing reading a command hook and just use conditions to prevent it firing on the first turn, which is why I suggested that route.

Ok. That was quite helpful.

So this is what I have tried successfully:

Before reading a command when the player is in the Small Bathroom: Say "BlaBla."
Now this works. The downside is that it prints the message every time a command is entered in the Bathroom. To circumvent this I tried this:

Before reading a command when the player is in the Small Bathroom for the first time: Say "BlaBla."

“for the first time” doesn’t have any effect. How must I write this so the message shows up only the first time the player enters the Bathroom and after that never again (or possibly only every time after he steps through the door leading to the Bathroom?)?


Brute-force, but it’ll work:

[code]First-bathroom-turn is a truth state that varies. First-bathroom-turn is true.

Before reading a command when the player is in the Small Bathroom and first-bathroom-turn is true:
say “BlaBla.”;
now first-bathroom-turn is false;

It works indeed! Congrats!

Man, I have a lot to learn. :wink: Thank you. Will make programming tutorial and help-statements a lot easier!

Thanks a bundle!