This is a script I wrote to read the in-game books from The Elder Scrolls II: Daggerfall outside of the game. If I write any other tools related to Daggerfall, they’ll probably also go here. Output may look slightly mangled, but that isn’t necessarily the program’s fault. There’s a good chance that the book liked like that in the original game.
Bethesda offers Daggerfall as a free download:
http://www.elderscrolls.com/daggerfall/
Books are stored in DFCD/DAGGER/ARENA2/BOOKS, and also in DAGGER/ARENA2/BOOKS, depending on your installation size. If you’re looking for a specific book, I included a list of titles and filenames in booklist.txt.
./dfbook [OPTIONS] [FILE]
FILE is the book file to read from. If FILE is omitted, the data will be read from the standard input.
Options:
- –help, -h
Print out help.
- -f, –format FORMAT
Specify the output format.
Default: text
Formats:
- text
Print out the book as plain text, losing some of its formatting.
- json
Dump the all of the book’s text and formatting data as a JSON object.
- book
Output in the original Daggerfall book format.
- text
- -o, –output FILE
Write the output to a file. If omitted, output goes to stdout.
- -i, –input-format FORMAT
Specify the input format. Accepted options are json, book, and markup.
Default: book
If the option -i markup is used, dfbook will accept a text file with some special formatting codes and convert it into a book. The following formatting codes are supported:
- %c Center the current line
- %s Display the current line in the script font
- %p End the page here
- %l Do not wrap or remove this line
- %% If you need to display a % character at the beginning of a line
Formatting codes can only appear at the beginning of a line, but a line can have more than one formatting code. After the text starts, formatting codes will not have any effect. %% counts as normal text for this purpose. All left-aligned, paragraphs that use the normal font will be reformatted to fit Daggerfall’s limit of 60 characters per line. Lines get broken up into pages automatically, so only insert a page break if it is necessary for a page to end at a specific place.
Trailing whitespace at the end of a line are eliminated. Repeated blank lines are treated as a single blank line, unless the %l format code is used.