Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF2010 Inquiry - thread from hair  (Read 2149 times)

Drakis

  • Bay Watcher
    • View Profile
DF2010 Inquiry - thread from hair
« on: July 23, 2010, 08:59:16 pm »

how would be the best way of going about setting it up to get thread from hair?

should i try and edit materials to get it to work, or would reactions be the best way?

does anyone else have something similar already set up that they could help me out with?
Logged

Shukaro

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #1 on: July 23, 2010, 11:02:33 pm »

My best guess would be to make a reaction that calls for hair and produces thread with the GET_MATERIAL_FROM_REAGENT matgloss. The tricky part is finding out what exactly to enter into the reagent field. A rough sketch would be.

[REACTION:WEAVE_HAIR]
   [NAME:weave thread from hair]
   [BUILDING:YOUR_CUSTOM_BUILDING_HERE:YOUR_HOTKEY_HERE]
   [REAGENT:A:1:ITEM_TOKEN_HERE(probably CORPSEPIECE):ITEM_SUBTYPE_HERE(not sure on this one, looking through the raws it might just be HAIR):MATGLOSS_HERE(this one should be CREATURE_MAT):MATGLOSS_SUBTYPE_HERE(should probably be left as none if you want to be able to take any creature's hair):NONE]
   [PRODUCT:100:1:THREAD:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE:THREAD][PRODUCT_DIMENSION:15000]

Then you could tack on the [SKILL:XXX] and/or [AUTOMATIC] tags if you wanted to use a skill or have it queue automatically whenever spare hair is around, respectively. This is an interesting topic, calling cosmetic tissues for reactions.

Of course, before being able to use a reaction like this, you'll need to have hair. Some things leave hair when butchered and some don't, you might need to do some creature modding to get more creatures to leave hair.
« Last Edit: July 23, 2010, 11:05:23 pm by Shukaro »
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

Kilumanjaro

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #2 on: July 24, 2010, 12:42:40 am »

You'll have to make some changes to the Hair template in material_template_default.txt for DF to see it as a cloth candidate.  Add the [SILK] tag at the end, to allow thread and cloth to be made from it, and change [ITEM_HARD] to [ITEM_SOFT] so it becomes a valid mat for clothes and bags etc.  Interestingly, I also tried to us [THREAD_PLANT] instead of [SILK], but that seems to not want to work.

Also, for any corpse piece to be used in a reaction, it needs a version of the tags that allow Skin to turn into Leather. (yes, this is defined in the raws now)  Check the vanilla raws in material_template_default in the skin entry and reaction_other in the tan a hide reaction for Toady's explanations.  I found them to be quite clear.  I can post my example later if you need more help.
Logged

Drakis

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #3 on: July 24, 2010, 05:10:57 am »

Of course, before being able to use a reaction like this, you'll need to have hair. Some things leave hair when butchered and some don't, you might need to do some creature modding to get more creatures to leave hair.

im not looking to mod any creatures, just find creative ways to use stuff that we have currently.  what prompted this was i changed some ethics in my dwarves to make them more evil, and i ended up butchering some elves that met an untimely end when they tried to sell me their garbage, and i ended up getting elf hair.    long, flowing elf hair would make nice thread....   elf hair cloth....   elf hair sutures...   



ok, i have this set up as a reaction:
[REACTION:WEAVE_HAIR]
   [NAME:weave hair]
   [BUILDING:LOOM:CUSTOM_H]
   [REAGENT:A:1:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT]
      [HAS_MATERIAL_REACTION_PRODUCT:HAIR_MAT]
   [PRODUCT:100:1:THREAD:NONE:GET_MATERIAL_FROM_REAGENT:A:HAIR_MAT]
   [SKILL:WEAVER]
   [AUTOMATIC]

and ive adjusted the hair entry in the materials to have this instead of item hard

   [MATERIAL_REACTION_PRODUCT:HAIR_MAT:LOCAL_CREATURE_MAT:THREAD]
   [SILK]
   [ITEMS_SOFT]


unfortunately, i need to sleep now and cannot test it tonight.   i will post results tomorrow after work
Logged

Patchouli

  • Bay Watcher
  • Where very delicious cake shop?
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #4 on: July 24, 2010, 05:18:48 am »

Of course, before being able to use a reaction like this, you'll need to have hair. Some things leave hair when butchered and some don't, you might need to do some creature modding to get more creatures to leave hair.

im not looking to mod any creatures, just find creative ways to use stuff that we have currently.  what prompted this was i changed some ethics in my dwarves to make them more evil, and i ended up butchering some elves that met an untimely end when they tried to sell me their garbage, and i ended up getting elf hair.    long, flowing elf hair would make nice thread....   elf hair cloth....   elf hair sutures...   



ok, i have this set up as a reaction:
[REACTION:WEAVE_HAIR]
   [NAME:weave hair]
   [BUILDING:LOOM:CUSTOM_H]
   [REAGENT:A:1:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT]
      [HAS_MATERIAL_REACTION_PRODUCT:HAIR_MAT]
   [PRODUCT:100:1:THREAD:NONE:GET_MATERIAL_FROM_REAGENT:A:HAIR_MAT]
   [SKILL:WEAVER]
   [AUTOMATIC]

and ive adjusted the hair entry in the materials to have this instead of item hard

   [MATERIAL_REACTION_PRODUCT:HAIR_MAT:LOCAL_CREATURE_MAT:THREAD]
   [SILK]
   [ITEMS_SOFT]


unfortunately, i need to sleep now and cannot test it tonight.   i will post results tomorrow after work
I imagine that you'd need to change the body_detail_plan files as well, and add    [ADD_MATERIAL:THREAD:THREAD_PLANT_TEMPLATE].
Logged

Kilumanjaro

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #5 on: July 24, 2010, 09:36:27 am »

im not looking to mod any creatures, just find creative ways to use stuff that we have currently.  what prompted this was i changed some ethics in my dwarves to make them more evil, and i ended up butchering some elves that met an untimely end when they tried to sell me their garbage, and i ended up getting elf hair.    long, flowing elf hair would make nice thread....   elf hair cloth....   elf hair sutures...   



ok, i have this set up as a reaction:
[REACTION:WEAVE_HAIR]
   [NAME:weave hair]
   [BUILDING:LOOM:CUSTOM_H]
   [REAGENT:A:1:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT]
      [HAS_MATERIAL_REACTION_PRODUCT:HAIR_MAT]
   [PRODUCT:100:1:THREAD:NONE:GET_MATERIAL_FROM_REAGENT:A:HAIR_MAT]
   [SKILL:WEAVER]
   [AUTOMATIC]

and ive adjusted the hair entry in the materials to have this instead of item hard

   [MATERIAL_REACTION_PRODUCT:HAIR_MAT:LOCAL_CREATURE_MAT:THREAD]
   [SILK]
   [ITEMS_SOFT]


unfortunately, i need to sleep now and cannot test it tonight.   i will post results tomorrow after work

I dunno if the Loom is one of the buildings that will accept custom reactions, please post if that did work out for you.

Then there is an error in your material entry... the last argument in the mat_reaction line tells DF that once the reaction is run, it should look for this new creature mat to change into, so thread is not a valid entry.  If you want to make another material named wool you could end up with +elf wool sock+, but then you would have to go back and add the wool material to the body detail plans, then add code to subtract it from any creature you don't want it on, like turtles.  For simplicity, its easiest to just point the whole process back to hair so change the stricken part of that line back to HAIR, like this:
    [MATERIAL_REACTION_PRODUCT:HAIR_MAT:LOCAL_CREATURE_MAT:HAIR]. 

Then don't forget to add the permitted reaction line to you entity, or it wont show up in your workshops. 
Note the the new reaction will also require a re-gen.
Logged

Quadricwan

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #6 on: July 24, 2010, 10:30:14 am »

Thread from hair - I LIKE that idea.
Logged
Why does life keep teaching me lessons I have no desire to learn?

Drakis

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #7 on: July 24, 2010, 08:04:29 pm »

my initial quick run though failed this morning, and now ive realized why.   first and foremost, i forgot to add the reaction to the entity file.   i also mislabeled the required job for the reaction.  its weaving, not weaver.

as for how to get hair, you can get hair from horses and mules as well, its part of their manes and tails and when butchered, they drop hair.


gonna try another run with some edits and fix-ups, will edit this post or make a new one if someone else replies first

------------
Edit:

AAHAHAHAHAHHAHAHA!!!!    IT WORKS!!!!!


[REACTION:WEAVE_HAIR]
   [NAME:weave hair]
   [BUILDING:TANNER:CUSTOM_H]
   [REAGENT:A:1:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT]
      [HAS_MATERIAL_REACTION_PRODUCT:HAIR_MAT]
   [PRODUCT:100:1:THREAD:NONE:GET_MATERIAL_FROM_REAGENT:A:HAIR_MAT]
   [SKILL:WEAVING]
   [AUTOMATIC]


   [MATERIAL_REACTION_PRODUCT:HAIR_MAT:LOCAL_CREATURE_MAT:HAIR]
   [SILK]
   [ITEMS_SOFT]


and it does it automatically at the tanners shop!     now to figure out something to do with hoof and teeth and feathers and such...
« Last Edit: July 24, 2010, 08:21:21 pm by Drakis »
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #8 on: July 24, 2010, 10:21:16 pm »

I am monitoring this thread. Closely. e.e
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

rex mortis

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #9 on: July 25, 2010, 09:35:59 am »

Hooves are considered horns for crafting purposes, as far as I know.
Logged
Because death is peaceful and magma is lovely.

rdwulfe

  • Bay Watcher
  • Rion Wulfe
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #10 on: July 25, 2010, 02:26:41 pm »

I am monitoring this thread. Closely. e.e

Heh. Thread.


...

Sorry, couldn't resist. *lurks more*
Logged
"   So the gods discussed it and created elves. The Elves were beautiful, Mistral Thrax admitted, in and elvish way, but it was his belief that the gods grew disappointed after a time because the elves -- being elves -- were essentially decorative but not particularly functional. They were content simply to live long lives and to exist. They did not nothing of any real value, in the opinion of Mistral Thrax."
   -- The Covenant of the Forge by Dan Parkinson, a Dragon Lance Novel

Altaree

  • Bay Watcher
    • View Profile
Re: DF2010 Inquiry - thread from hair
« Reply #11 on: August 10, 2010, 08:32:10 am »

Just did this and it works!  I am glad I have about 10 dummy reactions just sitting around waiting to be changed.  You need to regen the world for new reactions but not for alterations to existing reactions.
Logged
Dan Pearson:
This is a game which calculates the volume of blood in every creature it generates so it knows how much alcohol it would have to consume to get drunk, an update which, remarkably, ended up covering people's fortresses in cat vomit.