Adventure Book

version 1/110101 by Edward Griffiths

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Setting Up a Page

    A good start to any programming language is creating a program to write "Hello World!". So let's start with that and see how a page is set up.

        "The Hello World Story" by Edward Griffiths
        
        Include Adventure Book by Edward Griffiths
        
        The First Page is a page.
        "Hello World!"

    This is sufficient to create a running program. If you click Inform 7's Go! button, you'll be presented with the Adventure Book opening screen and prompted to continue. When you do, you'll be shown the text "Hello World!" and given a prompt. Of course, since we haven't created any options for the player to try, the program can't continue in any useful way.

    Notice how the page is written. The first line, "The First Page is a page.", tells Inform that we're creating a new page and we're calling it The First Page. On the next line, we write what it says on that page, surrounded by quotes. And that's really all there is to it.

    Pages can have just about any name you can think of. If it makes sense to you to call them "Page 1", "Page 2", and so on, that's fine. You can also name them after what happens on that page, such as "Exploring the Cave" or "Arguing with Robert". The only really important rule is that the first page of your story must be called The First Page.

    Notes for beginners: Whenever quoted text is used to describe a page or a choice, either the text must end with a sentence-ending punctuation mark (. ! ?) or there must be a period after the second quotation mark. All other sentences must end with a period. Within quoted text, replace all quotation marks with ' marks; the game will automatically replace them with the appropriate marks when the game is run. For example:

        "Margaret storms up to you. 'Do you really need the radio that loud?' she huffs."

    will be printed as:

        Margaret storms up to you. "Do you really need the radio that loud?" she huffs.