| Chapter 17: Activities |

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

281
| Example Blankness 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 statusline 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; change the left hand status line to "[location]"; change the right hand status line to "[turn count]". Before starting the virtual machine: change the left hand status line to ""; change the right hand status line to "". 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