§18.40. Starting the virtual machine

1. When it happens. This activity is provided solely as a "hook" for any low-level tasks which need to be performed when the virtual computer which runs Inform story files is starting up. This happens much earlier than "when play begins" rules, and should be used only as a last resort.

It should be remembered that Inform can produce story files for several different virtual computers. On some of these, it will not be safe to print any text during this activity, as the windows which would display such text do not yet exist.

2. The default behaviour. None.

3. Examples. No detailed examples will be given here, but the activity might be used (for instance) to set styles for the Glulx windows shortly to be brought into existence.


arrow-up.pngStart of Chapter 18: Activities
arrow-left.pngBack to §18.39. Amusing a victorious player
arrow-right.pngOnward to Chapter 19: Rulebooks: §19.1. On rules

Occasionally we want to print something as our first screen and then pause the game. By default, Inform will print a rather odd status line, with "You" on the left side and "0" on the right. This is because the left hand status line is set to display the location, but (because we're not done with the when-play-begins rules) the player has not yet even been moved to a room.

We can tidy this up in the "starting the virtual machine" activity, by temporarily changing the status line content. We will not provide game-pausing code here, because that is easily done by extension; so:

paste.png "Blankness"

Include Basic Screen Effects by Emily Short.

When play begins:
    say "take me home";
    wait for any key;
    say " yeah";
    wait for any key;
    say " yeah";
    pause the game;
    now the left hand status line is "[location]";
    now the right hand status line is "[turn count]".

Before starting the virtual machine:
    now the left hand status line is "";
    now the right hand status line is "".

Paradise City is a room. The description of Paradise City is "The grass is green and the girls are pretty."

Quite a modest effect, but occasionally useful.

*ExampleBlankness
Emptying the status line during the first screen of the game.

Occasionally we want to print something as our first screen and then pause the game. By default, Inform will print a rather odd status line, with "You" on the left side and "0" on the right. This is because the left hand status line is set to display the location, but (because we're not done with the when-play-begins rules) the player has not yet even been moved to a room.

We can tidy this up in the "starting the virtual machine" activity, by temporarily changing the status line content. We will not provide game-pausing code here, because that is easily done by extension; so:

paste.png "Blankness"

Include Basic Screen Effects by Emily Short.

When play begins:
    say "take me home";
    wait for any key;
    say " yeah";
    wait for any key;
    say " yeah";
    pause the game;
    now the left hand status line is "[location]";
    now the right hand status line is "[turn count]".

Before starting the virtual machine:
    now the left hand status line is "";
    now the right hand status line is "".

Paradise City is a room. The description of Paradise City is "The grass is green and the girls are pretty."

Quite a modest effect, but occasionally useful.

Occasionally we want to print something as our first screen and then pause the game. By default, Inform will print a rather odd status line, with "You" on the left side and "0" on the right. This is because the left hand status line is set to display the location, but (because we're not done with the when-play-begins rules) the player has not yet even been moved to a room.

We can tidy this up in the "starting the virtual machine" activity, by temporarily changing the status line content. We will not provide game-pausing code here, because that is easily done by extension; so:

paste.png "Blankness"

Include Basic Screen Effects by Emily Short.

When play begins:
    say "take me home";
    wait for any key;
    say " yeah";
    wait for any key;
    say " yeah";
    pause the game;
    now the left hand status line is "[location]";
    now the right hand status line is "[turn count]".

Before starting the virtual machine:
    now the left hand status line is "";
    now the right hand status line is "".

Paradise City is a room. The description of Paradise City is "The grass is green and the girls are pretty."

Quite a modest effect, but occasionally useful.