Start Room and some Miscellaneous Questions


I have two silly questions regarding Inform 7 that I can’t seem to find elsewhere. Or, at least, I don’t know enough to determine where I could find them.

  1. In regards to the start room, I understand that the first room described automatically becomes the start room. But, is there a way to explicitly make a room the start room, without having it be the first room being read by Inform 7?

  2. Introduction. When my game starts, I have something like this that shows up:

A Super Lab
A lab for experimentation of concepts ... by Justahack
Release 1 / Serial number 091123 / Inform 7 build 5Z71 (I6/v6.31 lib 6/12N) SD

All manner of experimentation is handled in this pristine white room. There is a door to the east, leading into the Storage Room.

I’ve been trying to use Emily Short’s Basic Screen Effects’ “wait for any key” to achieve an affect where the game will wait for any key after it finishes the line, “Release 1 / Serial number …”

Then clear the screen and prints out the lab, but I’m not certain how to achieve that. I’ve tried to do this,

"A Super Lab" by Justahack

Include Plurality by Emily Short.
Include Basic Screen Effects by Emily Short.

Section 0 - Metadata

The story genre is "Science Fiction". 
The story headline is "A lab for experimentation of concepts ..."
The release number is 1.
The story creation year is 2009. 
The story description is "In the bowels of a small mountain, a small lab was mysteriously carved, almost by 'magic'. Shielded from prying eyes that were not privy to x-ray goggles, this small lab was used by an apprentice in various experimentations involving the mysterious languge of I7."

wait for any key;
clear the screen;

But that just brings up an error. When I was perusing this forum, I believe I came across something explaining that a line like, “Let X be 100.” has to be put underneath a rule, so I suspect that there is a similarity here. Since this works fine:

every turn:
clear the screen;

Any information would be appreciated.

I think you just missed the “when play begins”.

When play begins: say "[story description]"; wait for any key; move the player to the lab.

I’m not sure this is documented; I could find examples of it in the docs, but no actual explanation. The syntax is “The player is in …” As in:[code]The Lab is a room.
North of the Lab is the Lobby.

The player is in the Lobby.[/code]

You’re right, all phrases like that (except statements that describe the initial state of the world) have to be inside rules or Inform wouldn’t know what to do with them.

The banner and initial room description are printed out by two consecutive rules in the startup rules: the display banner rule and the initial room description rule. They are both very simple:

This is the display banner rule: say "[banner text]". This is the initial room description rule: try looking.
To pause before the room description you can squeeze in a new rule between these two, or modify one of them, perhaps like this:

The display banner and pause rule is listed instead of the display banner rule in the startup rules. This is the display banner and pause rule: say "[banner text]"; wait for any key; clear the screen; say line break;

Ahh, thanks everyone. Your suggestions were very helpful. They were exactly what I was looking for, and a bit more. :smiley: I will have to examine the startup rules and rules in general a bit more.

I have a question inspired by the discussion of start-up text and banner text in this thread. I understand there an informal obligation to display the banner text of an Inform 7 game at some time near the beginning of play, which is no problem. Let’s say, however, that one wanted to get this out of the way as quickly as possible by making an introductory splash screen. If we write:

[code]The testarea is a room.

Include Basic Screen Effects by Emily Short.

The display banner rule is not listed in the startup rulebook.

When play begins:
say paragraph break;
say paragraph break;
center “[banner text]”;
say paragraph break;
say paragraph break;
say paragraph break;
center “Press a key to continue”;
wait for any key;
clear the screen;
center “[roman type]It was a dark and stormy night, etc, and you find yourself in the testarea.”;
say paragraph break.[/code]

The result is something that looks like this:

Nebulously Dramatic Title
An Interactive Fiction by Anonymous
Release 1 / Serial number 091202 / Inform 7 build 5Z71 (I6/v6.31 lib 6/12N) SD

                  Press a key to continue[/code]

which looks fairly silly. One would have hoped that by saying “center [banner text]” the result would be something like:

[code] Nebulously Dramatic Title
An Interactive Fiction by Anonymous
Release 1 / Serial number 091202 / Inform 7 build 5Z71 (I6/v6.31 lib 6/12N) SD

                        Press a key to continue[/code]

(if you’re viewing this on a small monitor or in a small window, the above may appear to look much worse than the first example; the point however is that each individual line of text is centered).

Apart from discarding the official banner text and composing a manually-constructed version with the proper type-setting, what would be involved in instructing Inform to achieve the second result on its own?

I got an interesting result when I tried a minimal example (just centering the banner text when play begins):

Error: Overflow in VM_PrintToBuffer.

And no centered banner.

So maybe constructing your own banner and centering it line by line may be necessary?

I got the same error as you George.

I’m not an Inform expert, but I would guess it may have something to do with the fact that the first line in the banner text (the game title) is bolded, and Basic Screen Effects disallows anything other than fixed-width fonts for centering*:

I don’t know what to offer you in terms of solutions, unfortunately, other than hard-coding the banner as you suggested.

  • This isn’t entirely accurate; putting small amounts of text and centering it seems to work, but writing any more than a sentence or so crashes the terp.

…Actually, I’m getting really inconsistant centering behaviour now, where any moderate sized piece of text, regardless of style, will bring up the VM_PrintToBuffer error as well as Fatal Error: Call to non-routine, crashing the game. I don’t think there’s any limit to the amount of text you can center (it’s not mentioned in the docs), but Basic Screen Effects might be trying to center the whole string on one line, even if it exceeds the screen width. [Sorta Ninja Edit: The same text with line breaks still crashes, so I guess not?]

But I don’t know, honestly. I’ve never had any centering trouble before. Weird.

@George and Kelly:

That “VM_PrintToBuffer” error you both noted has something to do with the z-machine. When I open a new Inform 7 project the first thing I do before typing anything is to switch the project file over to Glulx, but I should have appreciated while composing my question that not everyone follows such a practice. If you take the example code I posted and switch the project file over to Glulx, you shouldn’t see the error anymore.