A solution to present information about what raws are in your save game, in a searchable format.
I made this because I was playing with Splint's Vanilla Expanded Mod and Primal and at the prepare carefully screen I had no way to figure out what some of the animals were.
Yes there is the raw explorer program but I found that difficult to search with and the information was displayed in basically the same format as the raw file itself, so it was hard to read.
There is a Typescript type definition file.
Creates JSON from Dwarf Fortress raw files. This JSON can be used with the small web client to search through, be plopped into Algolia and search or, you could simply CTRL+F or grep for what you are looking for in the file itself. I find the JSON easier to read than the RAW txt files, and it currently doesn't include a lot of items that were not important to me when looking up creatures. I was most concerned with the description of the animal, if they laid eggs, if they were milkable, and how big they were.
| Property | Description | Type |
| ----------------- | --------------------------------------------- | -------------------------------- |
| identifier | defined in CREATURE token | String |
| parentraw | name of the raw file its located | String |
| objectId | unique id for creature | String |
| name | species name | String |
| namesmap | names by castes | HashMap
An example rust program which will parse a directory for DF raw files and then output the raws as JSON to be consumed by the simple web client in www/ for simple search and display functionality. The rust program is capable of serving the web client itself.
You can run this program after cloning this repository:
bash
cargo run --example cli -- --help
``` USAGE: cli.exe [OPTIONS]
OPTIONS: -h, --help Print help information
-o, --out-dir <OUT_DIR>
Specify the directory that the JSON database should be saved into.
If raw files are parsed, a JSON database (an array of objects) is
saved to disk in a location specified by this argument. This will
create an 'out.json' file in the directory specified by this argument.
[default: ./www/]
-p, --port <PORT>
Specify the port to run the web server on.
[default: 4501]
-r, --raws-dir <RAWS_DIR>
Specify the directory containing the raw files.
This usually is a directory named 'raw' in the save or game directory.
If this is left unspecified, no raws will be parsed when running.
[default: ]
-s, --serve
Include this flag to start a web server for the web search client.
Included in the repository is a 'www' folder with a small web client
that will fetch the JSON database created by this program (out.json)
and present it in a searchable manner to the user.
If you include this flag, after any parsing is done, a tiny HTTP server
will start server files from the directory specified by 'out-dir' which
defaults to ./www
-V, --version
Print version information
```
The example is a usable tool to search raws.
See the project Overseer's Reference Manual for a project that uses this library.
There is a Typescript definition file for the format of the generated JSON.
This all started with a perl script, I've archived that to a gist since it lost feature parity (and object similarity) to this project.