Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Newb trying to mod in animal dye... HELP!  (Read 1339 times)

jcnorris00

  • Bay Watcher
    • View Profile
Newb trying to mod in animal dye... HELP!
« on: June 14, 2011, 12:20:38 am »

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:
Spoiler (click to show/hide)

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:
Spoiler (click to show/hide)
(I also tried PLANT_POWDER_TEMPLATE instead of ANIMAL_POWDER_TEMPLATE.)

Reaction definition:
Spoiler (click to show/hide)

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.
Logged
My contribution to dwarven science: the dwarven kiddie pool

Zahariel

  • Bay Watcher
    • View Profile
Re: Newb trying to mod in animal dye... HELP!
« Reply #1 on: June 14, 2011, 06:21:36 pm »

I'm suspicious of your reaction. Have you tried putting it in a custom building, rather than at the existing STILL? Also, did you remember to add the reaction as a PERMITTED_REACTION to the dwarf entity? Finally, remember that creating reactions (but not modifying them) requires you to generate a new world with the reaction in it; so a lot of modders will just make Test Reaction A through Z so that they don't have to generate new worlds constantly.

But if the reaction isn't appearing in your still, I would bet that you didn't PERMIT it in the entity. Keep us posted, this looks like fun!
Logged

jcnorris00

  • Bay Watcher
    • View Profile
Re: Newb trying to mod in animal dye... HELP!
« Reply #2 on: June 14, 2011, 09:17:28 pm »

I was trying to avoid custom buildings; I'm having enough trouble adding a custom dye!

I had scaled back my ambitions to grinding cinnabar at a mill to make vermilion pigment.  This was used in paint, not dyeing, but I was desperate for a powdery pigment that didn't come from a plant.  I added a MATERIAL_REACTION_PRODUCT and REACTION_CLASS:GRINDABLE to cinnabar, defined a VERMILION_DYE product in inorganic_other.txt, then added a reaction to reaction_other.txt to create a powder from GRINDABLE rock at a quern or millstone.  (I had envisioned grinding rock salt for use in the kitchen, although I suppose that might lead to +table salt roasts+.)

Anyway, when I tried it, I immediately noticed that cinnabar was listed as an economic stone.  Yay!  But there was no "Grind stone to powder" job at the quern.  Boo!

And then I checked the message boards and saw your reply, Zahariel.  This is the first I've heard of PERMITTED_REACTION (like the subject says, I'm a newb).  I quickly added the appropriate tag and lo and behold, my dwarves have a bag of vermilion dye, and soon after that, a vermilion pig tail thread expertly colored with vermilion dye.  Woohoo!  Thanks!

Unfortunately this doesn't open the way for liquid dyes, but maybe now I can successfully create some sort of dessication reaction to convert a liquid dye to powder form.  That's not what happens in the real world, but oh well.

Hmm, sepia dye was originally made from the ink of cuttlefish.  Cuttlefish saliva contains a neurotoxin.  Who says dyeing can't be Fun?   :D
« Last Edit: June 14, 2011, 09:20:04 pm by jcnorris00 »
Logged
My contribution to dwarven science: the dwarven kiddie pool