Adventure Book

version 1/110101 by Edward Griffiths

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Porting Original Adventure Book Programs

    It's relatively simple to import code from the original Adventure Book into Adventure Book for Inform 7. ADV files are human-readable, plain text files that can be opened with any text editor. This section details how to convert existing Adventure Book games into new projects that can be compiled in Inform 7.

    First, let's look at an example of how a page is described in an ADV file:

        * YourHouse
         Your house is a rather modest little shack near the edge of town. It keeps
        the wind and the rain out on sunny days.
        +Venture forth+Road
        +Consider the loaf of bread on the table+Considerbread~@-BREADGONE

    An ADV file declares the name of a page with a line that begins with an asterisk (*). The line "* YourHouse" translates to:

        YourHouse is a page.

    Text that doesn't begin with a special symbol is the description of the page. This can stay more or less as it is, but it should be enclosed in quotation marks, and any internal quotation marks should be replaced with ' marks.

    A + sign indicates a choice. The text after the first + sign is the description of the choice. The text after the second + sign is the name of the page that it opens to. "+Venture forth+Road" translates to:

        A choice called yourhousea is for YourHouse. "Venture Forth". It triggers Road.

    A tilde (~) indicates a condition. The text immediately after the tilde is the name of the flag or inventory item that the condition is checking for. If the name begins with an @ sign, it is an "It is cancelled by ..." condition. Otherwise, the condition would be an "It requires ..." condition. If there is a - sign before the name, it is checking for a flag. Otherwise, it is checking for an inventory item. So "~@-BREADGONE" is an "It is cancelled by ..." condition that is checking for a flag. The last line of the example translates into this:

        A choice called yourhouseb is for YourHouse. "Consider the loaf of bread on the table". It triggers Considerbread. It is cancelled by BREADGONE.

    There may be multiple conditions on the same line, all separated by tildes. A line like "~-DUCKGONE~@-MUSICON~RADIO~@SANDWICH" can be broken down into four sentences:

        It requires DUCKGONE. It is cancelled by MUSICON. It requires the radio. It is cancelled by the sandwich.

    where the radio and the sandwich are inventory items that are declared at the beginning of the text.

    Put it all together, and the example page looks like this:

        YourHouse is a page.
        "Your house is a rather modest little shack near the edge of town. It keeps
        the wind and the rain out on sunny days."
        A choice called yourhousea is for YourHouse. "Venture Forth". It triggers Road.
        A choice called yourhouseb is for YourHouse. "Consider the loaf of bread on the table". It triggers Considerbread. It is cancelled by BREADGONE.

    A line that starts with a # indicates a special command for the ADV file reader. "#div" is a diversion to the page named immediately following "#div". For example, "#divForest5" would translate to:

        It is followed by Forest5.

    "#ret" is a "return", called a dead end in the Inform 7 version. "#ret" translates directly into:

        It is a dead end.

    "#win" and "#die" are commands for ending the game. The closest thing to this in Inform 7 is diverting to The Last Page:

        It is followed by The Last Page.

    Lines that begin with ">" and "<" signs are "It gives ..." and "It removes ..." commands, respectively. So ">SWORD" becomes:

        It gives the sword.

    where the sword is an inventory item, and "<-BRIDGEBARRED" becomes:

        It removes BRIDGEBARRED.

    where BRIDGEBARRED is a flag.

    A line that begins with a colon (:) is a use. The text after the first colon is the item that's being used, and the text after the second colon is the page to turn to if that item is used. So a line like ":LICENSE:TakeBridge" becomes:

        A use called crossbridgea is for CrossBridge. It triggers TakeBridge. It uses the license.