Books, Screen text, and "Readable" Objects

This tutorial is intended to teach the basics of creating books and the required elements. It will also explain how to apply those concepts to arbitrary objects, enabling you to "read" a loaf of bread, for example. I assume that you have read all the DromEd documentation (in the \docs folder after installing DromEd), and have a working level in which to place your book. That means that you have taken all the preliminary steps, including loading ConVict, creating a starting point and linking it to Garrett, applying room brushes, and anything else that may be needed. I make no guarantees about anything I say here, and have actually only spent a few minutes experimenting, but I believe I understand the concepts. I have also tested all of my examples. If you find any mistakes in this document, please inform me by E-mailing me at goodsell@bridgernet.com or slpkn@cc.usu.edu or through the Thief Editor's Guild forum at ttlg.gameforum.com. Let's get it on!

The Basics

There are four basic elements that are required to let Garrett read something:

1) The text file. All books are kept in a text file with the .str extension. The file must be placed in the Thief\Books\English directory. The \English directory is not necessary if you are not planning on including multi-lingual support. In fact, it should probably only be used if you are. If you don't use the \English directory, book files go directly in the \Books directory.

2) The frob information. "Frob," in DromEd, means "use." The frob information is contained in the FrobInfo property and describes what happens when an object is used. A book must be "frobbable."

3) The StdBook script. The book must have a Script property with StdBook in one of the fields. I don't know if it has to be the first field, but I imagine that it will work in any of them. (Sometimes StdScroll is used instead. I'm not clear on the distinction, except for what I mention in the final example.)

4) The Book properties. There are two types of Book properties. Text is required (for obvious reasons) and that is where you type the name of the file that contains the text you wish to be displayed. The Art property tells which paper texture to use when displaying the text. If it is absent, the text is simply displayed at the top of the screen. (I have not tested this thoroughly, but it seems to be the case.)

Adding a Book to Your Level

First, open Notepad to create your text file. Notepad is a good choice because it only saves in plain text format. WordPerfect, for example, saves in a completely different format that DromEd does not understand. Likewise with MS Word.

In notepad, type the following:

Page_0: "This is the text that will be displayed. You must always
start your book on page zero and count up from there, using this
exact format for each page..."

Page_1: "the word Page, followed by an underscore, followed by the
page number. Then a space and a double quote before beginning the
text. It must also end with a double quote."

Save this file in the Thief\Books\English directory with the name testfile.str. Windows might have a nasty trick in store for you here. Notepad may tag on an extra extension, making the file name testfile.str.txt. You may not even be able to see this extra extension. Right click on the file and select properties. Look at the extension on the MS-DOS Filename. It should be .str. If it is not, here is how to avoid this problem. When saving, enclose the whole filename in double quotes, like this: "testfile.str". I have heard that changing the Save as Type from Text documents to All Files (*.*) may fix it also.

Now, open DromEd and load your level. (If DromEd is open when you save your text file it may not find it. Close DromEd and restart it to correct the problem.) Go to the Object Hierarchy and select a book from Physical-Household-Book. I am using the HammerBook. After creating the book, go to its properties. Books already have two of the four things we need: FrobInfo and the StdBook script. If you search through the parent objects you will find them. Books also come supplied with the Book-Art property. We only need to add Book-Text and the actual file. We've already got the file, so all that's left is the Book-Text property. Click Add-Book-Text. Type testfile (our filename, minus the extension) in the new dialog box and click OK. Click Done to exit the Properties box and go to game mode. You should be able to read your book.

Other Readables

Plaques (found under Physical-Decorative) are made in much the same way as books. You need only add the text file and the Book-Text property. Note that plaques do not have a Book-Art property, the lack of which causes their text to be drawn directly on the playing screen. Only the first page is displayed. Adding the Book-Art property to a plaque causes it to be read like a book. Possible art types are: graveD10, ledger, ledger2, parch, parch2, parch3, pbook, pbook2, plaque, and stoned4. I have only tried a few of these. They come from directory names in the Books.crf file. There is a good chance that you'll never need to use them.

But, enough easy stuff. Let's do something different. How about a readable Horn of Quintus? Add a Horn of Quintus to your level (from Physical-Treasure-Quest items) and go to its properties. The horn already has FrobInfo from one of its parents, but we need to change it. We do that by adding FrobInfo, which will override the original. Click Add-Engine Features-FrobInfo. The World Action describes what happens when you use the horn as it sits in the world. It is set to Move, which means you pick it up. Click the World action button and select Script. This tells DromEd that the horn's Script should be activated when it is frobbed in the world. It has no script yet; we will add it shortly. You can leave the Move action or remove it. If it is removed, the horn will not be able to be picked up. It will only display text. If you leave it, the text will be displayed when the horn is picked up. Click OK to exit the dialog box and return to the Properties dialog.

Now we will add the StdBook script. Click Add-S-Scripts. Type StdBook in the first field. This script tells Thief to display the text associated with the object and is activated when we frob the horn because of the frob information we set before. Click OK to leave the dialog and return to the Properties dialog.

Since we will use our test file from before, we need not create a new one. That leaves only one thing to add of our four requirements. The Book-Text property. Remember this one? Click Add-Book-Text and type testfile. Click OK, click Done and go to game mode. You should be able to "read" the Horn of Quintus.

Now for one last example. Go back to the Horn's properties. Click its FrobInfo and then click edit. Notice the Inv Action button. This describes what actions to take when an object is frobbed from Garrett's inventory. Click on it and select script, then click on World action and deselect script. Select Move again if you turned it off earlier. Now edit the Scripts property and change it to StdScroll. I don't know why this has to be changed. It seems to be required for reading something from your inventory. Go back to game mode. Now the horn is read when you use it from your inventory.

I hope this helps you figure out how books work and how to use them. As always, remember to experiment and look at examples. Have fun.

-Kevin Goodsell, 6-19-99