More issues with Banner text

Hi, sorry, seeing some off behavior with following code:
“Game” by Ade McT

[code]The story headline is “An interactive game”.
The story genre is “science fiction”.
The release number is 1.

Include Basic Screen Effects by Emily Short.

t_mode is a truth state that varies. t_mode is true.

Rule for printing the banner text when t_mode is true: do nothing.

When play begins:
say “some text blah blah”;
now t_mode is false;
pause the game;
say “[banner text]”;
say “Some opening text.”;
say “more text”;
now the player is in the Second Room.

The Second Room is a room. The description of it is “Some text”.[/code]

This is the output:

some text blah blah

Please press SPACE to continue.

Game
An interactive game by Ade McT
Release 1 / Serial number 151130 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD
Some opening text.
more text
Second Room
Some text

Game
An interactive game by Ade McT
Release 1 / Serial number 151130 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

Second Room
Some text

If I comment out the 'say"[banner text line]";
This is the output:

some text blah blah

Please press SPACE to continue.

Some opening text.
more text
Second Room
Some text

Game
An interactive game by Ade McT
Release 1 / Serial number 151130 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

Second Room
Some text

What am I doing wrong?
Thank you!

“When play begins” rules run before the banner text shows by default.

Thanks, So…and I realise this is a silly question, but how do I move the player after when play begins, and after printing the banner text, but without it printing the room name twice?

It sounds so simple - but I’ve been banging my head against it for ages.

[code]“Game” by Ade McT

When play begins:
say “some text blah blah”;
now the player is in the Second Room.

The First Room is a room.
The Second Room is a room.[/code]

Results in:
some text blah blah
Second Room
Game
An Interactive Fiction by Ade McT
Release 1 / Serial number 151130 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

Second Room

It prints the room name twice.

“Move the player to [the second room], without printing a room description.”

Aaaargh!!! That works! Thank you! It seems so obvious - but why would that work? Why would it now still only print one description? I would have that it would have printed no description at all!

You’re mistaking how the code you’ve created will affect the game. :slight_smile:

Take a look in the Index generated when your game compiles. Go to “Standards” (blue box with “St”) in the Rules section. Scroll down to the section titled “The Top Level”. There you will see that the “printing the banner text” is an activity under the “startup rules” rulebook. Click the plus sign by the startup rulebook to see all the rules in it.

You can see that the “when play begins” rulebook is run via a rule within the startup rules (“when play begins stage rule”). It actually comes before the default “display banner rule,” so the first banner you’re seeing in output is actually the one you are getting from your “say ‘[banner text]’” command. Likewise, the first room description is from your “now the player is in …” statement.

You probably want to be modifying the startup rulebook as well as the when play begins rulebook. For example, you might wish to delist or replace the “display banner rule” and the “initial room description rule”.

Some things to look into:

  • See WWI 3.1 “Descriptions” for a (perhaps misplaced) note about how to start the player in the room you want, instead of having to move it there when play begins.
  • See WWI 4.12 “Values that vary” for a slightly cleaner way to set the initial value of t_mode (though I don’t think you really need that variable to do what you seem to be trying to do)
  • See WWI 8.9 “Moving the player” for discussion about why the room description is generated and how to avoid it
  • See WWI 19.4 “Listing rules explicitly” for tips on how to manipulate rule placement and ordering within rulebooks, and WWI 19.5 “Changing the behavior of rules” for substituting your rules for Standard Rules.

A note: Right now, you may be thinking “Why is this so hard to do in Inform 7?” It’s not really; you just have to realize that, in this case, you’re not dealing with Inform 7 the programming language so much as you are the system (built in I7) that is Standard Rules.

Changing the way things work by default means being able to understand and manipulate the Standard Rules. The Standard Rules are somewhat self-documenting (assuming you know enough I7 to understand what they mean, WWI helps with this) and also well-covered by the IDE’s Index, but they’re rarely discussed in depth in WWI, and understanding them is often critical to get what you want (as here). Get used to popping them open (“File > Open Extension > Graham Nelson” on the IDE top menu) and taking a look; in my mind, they’re as much of a primary text as WWI is.

When the game begins, the game automatically executes a “look” action to print the initial description.