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
|
| rawmodule | id of the raws module raw is from | String
|
| rawmoduleversion | version of the raws module raw is from | String
|
| objectId | unique id for creature | String
|
| name | species name | String
|
| namesmap | names by castes | HashMap<String, Vec<String>>
|
| descriptions | descriptions by castes | HashMap<String, String>
|
| maxage | max age by castes | HashMap<String, [u16; 2]>
|
| clutchsize | clutch size by castes | HashMap<String, [u16; 2]>
|
| basedon | defined by copytagsfrom token | String
|
| biomes | biomes creature found in | Vec<String>
|
| clusterrange | cluster range (how many appear at once) | [u16; 2]
|
| undergrounddepth | depth found | [u16; 2]
|
| bodysize | body size by castes | HashMap<String, Vec<DFBodySize>>
|
| grownat | age when adult by castes | HashMap<String, u32>
|
| childat | age when adolescent by castes | HashMap<String, u32>
|
| eggsizes | egg size by castes | HashMap<String, u32>
|
| petvalue | pet value by castes | HashMap<String, u16>
|
| intelligence | intelligence by castes | HashMap<String, [bool; 2]>
|
| flier | flier by castes | HashMap<String, bool>
|
| gnawer | gnawer by castes | HashMap<String, bool>
|
| trainable | trainability by castes | HashMap<String, u8>
|
| activetime | active time by castes | HashMap<String, u8>
|
| inactiveseason | NOSEASON by castes | HashMap<String, u8>
|
| creatureclass | creature class by castes | HashMap<String, Vec<String>>
|
| tags | tags on the creature | Vec<CreatureTag>
|
| castetags | tags on each caste | HashMap<String, Vec<CasteTag>>
|
| difficulty | difficulty by castes | HashMap<String, u32>
|
| grasstrample | grass trample by castes | HashMap<String, u8>
|
| grazer | grazer by castes | HashMap<String, u32>
|
| lowlightvision | low light vision by castes | HashMap<String, u32>
|
| popratio | population ratio by castes | HashMap<String, u16>
|
| milkable | milk production by castes | HashMap<String, DFMilkable>
|
| prefstring | preference string for creature | Vec<String>
|
| populationnumber | pop num (how many exist per valid world tile) | [u16; 2]
|
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
```sh Library which parses Dwarf Fortress raw files into JSON
Usage: cli.exe [OPTIONS]
Options:
-g, --game-dir
This directory will likely include the 'gamelog.txt' file, and it should have a 'data' subdirectory.
[default: ]
-o, --out-dir
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/]
-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
-p, --port
[default: 4501]
-h, --help
Print help information (use -h
for a summary)
-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.