17.38. Starting the virtual machine

| Chapter 17: Activities |

| 17.38. 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.

373
| Example Blankness Emptying the status line during the first screen of the game. |
RB

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: "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.

Previous | Contents | Next