I wrote in the DF suggestions forum that currently dyes are boring. I suggested a DF equivalent to Tyrian purple dye, which comes from a snail. In real life it was produced in two ways: by "milking" the snail, which was very slow but preserved the snail; or by simply crushing the snails, which was very fast but left you with no snails. I suggested that a new VERMIN_FISH could fill this role in DF.
Other users suggested creating a mod, and I decided to try it. I've hit some fairly big obstacles, though, and I'm not sure what I'm doing wrong, or if this is even possible in any satisfying way.
Here's what I
really want: an aquatic VERMIN_FISH creature that can be either slowly "milked" without harm at a fishery (not a farmer's workshop) or quickly crushed (with harm) at a press to produce a vial of dye.
Here's what I decided to settle for: an aquatic VERMIN_FISH creature that can either be milked at a farmer's workshop or targeted with "extract from a raw fish" at a fishery; again, both processes should produce the same product (a vial of dye).
For testing purposes, I modded turtles, since they're plentiful and easy to find. I added the following to the turtle entry, between the MUNDANE and CASTE tags:
[USE_MATERIAL_TEMPLATE:DYE:CREATURE_EXTRACT_TEMPLATE]
[STATE_NAME:ALL_SOLID:frozen turtle dye]
[STATE_ADJ:ALL_SOLID:frozen turtle dye]
[STATE_NAME:LIQUID:turtle dye]
[STATE_ADJ:LIQUID:turtle dye]
[STATE_NAME:GAS:boiling turtle dye]
[STATE_ADJ:GAS:boiling turtle dye]
[PREFIX:NONE]
[MILKABLE:LOCAL_CREATURE_MAT:DYE:20000]
[EXTRACT:LOCAL_CREATURE_MAT:DYE]
I could successfully milk turtles (extracting from one required a flask, which I didn't have), and I was even able to embark with "turtle dye", found under animal extracts. Unfortunately I couldn't use it to dye anything. The other dyes have the POWDER_DYE tag, as well as various color-related tags. I added those, but it still didn't work. I changed POWDER_DYE to LIQUID_DYE out of an excess of optimism, but it still didn't work. Is there more to this that I'm missing, or is DF hardcoded to only recognize powdered dyes?
Not ready to give up, I broke the dye into extract and dye products in the turtle description, and then tried to define a reaction to produce "turtle dye" from "turtle extract" at a still.
New turtle entries:
[USE_MATERIAL_TEMPLATE:EXTRACT:CREATURE_EXTRACT_TEMPLATE]
[STATE_NAME:ALL_SOLID:frozen turtle extract]
[STATE_ADJ:ALL_SOLID:frozen turtle extract]
[STATE_NAME:LIQUID:turtle extract]
[STATE_ADJ:LIQUID:turtle extract]
[STATE_NAME:GAS:boiling turtle extract]
[STATE_ADJ:GAS:boiling turtle extract]
[MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_CREATURE_MAT:EXTRACT]
[PREFIX:NONE]
[MILKABLE:LOCAL_CREATURE_MAT:EXTRACT:200]
[EXTRACT:LOCAL_CREATURE_MAT:EXTRACT]
[USE_MATERIAL_TEMPLATE:DYE:ANIMAL_POWDER_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:turtle dye]
[STATE_COLOR:ALL_SOLID:INDIGO]
[DISPLAY_COLOR:1:0:0]
[MATERIAL_VALUE:30]
[POWDER_DYE:INDIGO]
[PREFIX:NONE]
(I also tried PLANT_POWDER_TEMPLATE instead of ANIMAL_POWDER_TEMPLATE.)
Reaction definition:
[REACTION:MAKE_TURTLE_DYE]
[NAME:Make turtle dye]
[BUILDING:STILL:CUSTOM_D]
[REAGENT:extract:150:LIQUID_MISC:NONE:CREATURE_MAT:TURTLE:EXTRACT]
[UNROTTEN]
[REAGENT:extract container:1:NONE:NONE:NONE:NONE]
[CONTAINS:extract]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:bag:1:BOX:NONE:NONE:NONE]
[EMPTY]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:5:POWDER_MISC:NONE:GET_MATERIAL_FROM_REAGENT:extract:POWDER_MAT][PRODUCT_POWDER]
[PRODUCT_TO_CONTAINER:bag]
[PRODUCT_DIMENSION:150]
[SKILL:BREWING]
The reaction doesn't show up in my still.
Do dyes have to be a (possibly plant) powder? Can a reaction convert an animal extract into a usable dye? Is milking hardcoded to use buckets? Is extracting from animals hardcoded to use flasks? Should I have chosen a less ambitious project for my first mod attempt?
Any suggestions would be appreciated.