§9.6. Reading Matter
Many things can be read, from warning notices to encyclopaedias, and a range of techniques is needed to provide them because the quantity of text, and how it presents itself, can vary so much. With a small amount of very large type, the player should not need any command at all to read the text:
The road sign is in the Junction. The road sign is fixed in place. "A road sign points north: 'Weston on the Green - 6'."
If the print is smaller, or the object portable, the player will expect to use the EXAMINE command:
The business card is in the Junction. The description is "'Peter de Sèvres: consultant mnemonicist.'"
But if the object is a leaflet, say, EXAMINE should only describe the cover: READ would be the command a player would expect to use to get at the text itself. Inform normally defines READ to be the same command as EXAMINE, which is good for things like the business card, but counter-productive here. The Trouble with Printing shows how to separate these two commands, allowing any thing to have a property called its "printing" for text produced by READ, which will be different from its "description", the text produced by EXAMINE.
If the object is a lengthy diary, say, nobody would read it from cover to cover in a single IF turn. We might then want to allow the player to turn the pages one by one, with commands like READ PAGE 4 IN DIARY or READ THE NEXT PAGE: see Pages.
If the object is an encyclopaedic reference work, the player would consult named entries: see Costa Rican Ornithology, which allows commands like LOOK UP QUETZAL IN GUIDE.
Still larger sources of text often occur in IF: libraries or bookshelves, where many books are found together, and it is clumsy to write them as many individual items. One approach is to simulate an entire bookshelf with a single thing: see Bibliophilia. (This is much like looking up topics in a single book, except that each topic is a book in itself.) Another is to provide each book as an individual item, but have them automatically join together into a single portable collection: see AARP-Gnosis.
Signs, leaflets and encyclopaedias, being printed, have a wording which will never change during play. But sometimes the player reads something which acts of its own accord. Text substitutions are usually all that is needed to achieve this:
The computer display is on the desk. The description is "Giant green digits read: [the time of day]."
This is easy because we know all the variations we want. But what if we want the player to write his own text, for instance, adding to a diary? This is trickier, because it means storing text as the player typed it, and replaying it later. (And suppose the player types reams and reams of text, not just a few words as we might have hoped?) The Fourth Body and The Fifth Body show how to use an external file - a multimedia trick requiring features only available if the project is set to the Glulx story file format - to handle even the most difficult cases.
Should we want a computer that responds to vocal commands, as in ASK COMPUTER ABOUT KLINGONS, the built-in extension Inanimate Listeners will allow the player to talk to inanimate objects as well as people.
| ExamplePages A book with pages that can be read by number (as in "read page 3 in...") and which accepts relative page references as well (such as "read the last page of...", "read the next page", and so on).
|
|
Suppose we want a bookshelf with a very large number of books on it. They aren't to be taken or carried around in the game, but they should be mentioned, and the player should be allowed to look them up by name. Furthermore, the player's attempts to examine something unrecognized should be understood as an attempt to look up a title -- but only when the player is in the presence of the books. The rest of the time such requests should be rejected in the usual way.
"Bibliophilia"
The Graduate Lounge is a room. "Shabby sofas; plastic cups remaining from the afternoon's pre-lecture espresso; a collection of Xena and Hercules figurines posed for ironic effect. It's somewhat depressing at this hour, when everyone has gone home."
The Classics Reading Room is south of the Lounge. "Not as large a collection as the one in the Library, but it contains copies of everything really essential for reference."
Understand "examine [text]" as examining as a book when the player is in the Reading Room. Understand "look up [text]" as examining as a book when the player is in the Reading Room.
Examining as a book is an action applying to one topic.
Carry out examining as a book:
say "You can't find any such text."
Instead of examining as a book a topic listed in the Table of Book Titles:
say "[description entry][paragraph break]"
Table of Book Titles
topic | title | description |
"Reading Greek Death" or "reading/greek/death" or "greek death" | "Reading Greek Death" | "A dense orange paperback treatise on the development of Greek eschatology." |
"TAPA/Transactions/134-2" | "TAPA 134-2" | "Transactions of the American Philological Association from 2004." |
"Oxford Classical Dictionary" or "OCD/dictionary/classical/oxford" | "Oxford Classical Dictionary" | "A hefty reference with short articles on everything from Greek meter to ancient cosmetics." |
"Collected Dialogues of Plato" or "Plato/dialogues/hamilton/cairns" | "Collected Dialogues of Plato" | "All the Platonic dialogues -- some, admittedly, in rather tired translations -- but still a useful single volume, ed. Edith Hamilton and Huntington Cairns." |
"Adobe Illustrator CS User Guide" or "user guide" or "adobe illustrator" or "adobe/illustrator/cs/user/guide" | "Adobe Illustrator CS User Guide" | "Hello, how did this get here? A suspiciously familiar name is scribbled inside the front cover..." |
Some books are scenery in the Reading Room. Understand "copies" or "book" or "shelf" or "shelves" as the books. Instead of examining the books:
choose a random row in the Table of Book Titles;
say "You scan the shelves and notice, among others, a volume entitled [italic type][title entry][roman type]."
Test me with "south / examine ocd / examine books / examine books / examine plato / n / x hercules / s / x hercules".
Now if we type >X HERCULES in the Lounge, we will get
>x hercules
You can't see any such thing.
thanks to our somewhat slovenly implementation of the Lounge scenery; but in the Reading Room,
>x hercules
You can't find any such text.
In practice we might also want to extend our coverage somewhat to handle a case where the player tried to take books from the bookshelf: currently that would not be understood.
|  ExampleBibliophilia A bookshelf with a number of books, where the player's command to examine something will be interpreted as an attempt to look up titles if the bookshelf is present, but otherwise given the usual response.
|
Suppose we want a bookshelf with a very large number of books on it. They aren't to be taken or carried around in the game, but they should be mentioned, and the player should be allowed to look them up by name. Furthermore, the player's attempts to examine something unrecognized should be understood as an attempt to look up a title -- but only when the player is in the presence of the books. The rest of the time such requests should be rejected in the usual way.
"Bibliophilia"
The Graduate Lounge is a room. "Shabby sofas; plastic cups remaining from the afternoon's pre-lecture espresso; a collection of Xena and Hercules figurines posed for ironic effect. It's somewhat depressing at this hour, when everyone has gone home."
The Classics Reading Room is south of the Lounge. "Not as large a collection as the one in the Library, but it contains copies of everything really essential for reference."
Understand "examine [text]" as examining as a book when the player is in the Reading Room. Understand "look up [text]" as examining as a book when the player is in the Reading Room.
Examining as a book is an action applying to one topic.
Carry out examining as a book:
say "You can't find any such text."
Instead of examining as a book a topic listed in the Table of Book Titles:
say "[description entry][paragraph break]"
Table of Book Titles
topic | title | description |
"Reading Greek Death" or "reading/greek/death" or "greek death" | "Reading Greek Death" | "A dense orange paperback treatise on the development of Greek eschatology." |
"TAPA/Transactions/134-2" | "TAPA 134-2" | "Transactions of the American Philological Association from 2004." |
"Oxford Classical Dictionary" or "OCD/dictionary/classical/oxford" | "Oxford Classical Dictionary" | "A hefty reference with short articles on everything from Greek meter to ancient cosmetics." |
"Collected Dialogues of Plato" or "Plato/dialogues/hamilton/cairns" | "Collected Dialogues of Plato" | "All the Platonic dialogues -- some, admittedly, in rather tired translations -- but still a useful single volume, ed. Edith Hamilton and Huntington Cairns." |
"Adobe Illustrator CS User Guide" or "user guide" or "adobe illustrator" or "adobe/illustrator/cs/user/guide" | "Adobe Illustrator CS User Guide" | "Hello, how did this get here? A suspiciously familiar name is scribbled inside the front cover..." |
Some books are scenery in the Reading Room. Understand "copies" or "book" or "shelf" or "shelves" as the books. Instead of examining the books:
choose a random row in the Table of Book Titles;
say "You scan the shelves and notice, among others, a volume entitled [italic type][title entry][roman type]."
Test me with "south / examine ocd / examine books / examine books / examine plato / n / x hercules / s / x hercules".
Now if we type >X HERCULES in the Lounge, we will get
>x hercules
You can't see any such thing.
thanks to our somewhat slovenly implementation of the Lounge scenery; but in the Reading Room,
>x hercules
You can't find any such text.
In practice we might also want to extend our coverage somewhat to handle a case where the player tried to take books from the bookshelf: currently that would not be understood.
|
|  ExampleAARP-Gnosis An Encyclopedia set which treats volumes in the same place as a single object, but can also be split up.
|
|
|  ExampleThe Fifth Body An expansion on the notebook, allowing the player somewhat more room in which to type his recorded remark.
|
|