Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)  (Read 3160 times)

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #15 on: February 19, 2011, 01:52:32 pm »

It looks like the blood is not LIQUID_MISC.

Oops, I did not mean that. Hang on, testing.
« Last Edit: February 19, 2011, 01:56:11 pm by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

silverskull39

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #16 on: February 19, 2011, 01:53:46 pm »

But what would it be, then? LIQUID_CREATURE_MAT? I thought that was a subtype of LIQUID_MISC, but I'll try it out.
Logged
Quote
Quote
Quote
Dwarf fortress threads can sound so.... unethical
it would be unethical if this wasn't the bay12 forums
Bay12: A short, sturdy forum fond of !!science!! and derailment.
Quote
Now back to your regularly scheduled thread derailment.

D_E

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #17 on: February 19, 2011, 01:56:18 pm »

@Panthera Leo:  Oh, I think I get it now.  I was fixating on the SYNDROME stuff.  The REACTION_PRODUCT stuff is neat.  This feature has been around for a while, though, so it'll be old news for some people.  But in my case I never used material_reaction_products, even though there was one case in which I really should have.   So, thanks!

@silverskull:

Adding
Code: [Select]
[MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD:LOCAL_CREATURE_MAT:BLOOD] to the muscle entry of material_default.txt might work.  Or it might crash the game (or just cause an errorlog entry).

If it doesn't work, try adding a COOKING_BLOOD (use the blood template) entry to the TOP of standard_materials (b_detail_plan_default), and change the above line to
Code: [Select]
[MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD:LOCAL_CREATURE_MAT:COOKING_BLOOD]
That should definitely work, but is a touch less elegant.

The reaction would then be
Code: [Select]
[REACTION:PRESS_MEAT]
   [NAME:press blood from meat]
   [BUILDING:SCREW_PRESS:CUSTOM_T]
   [REAGENT:meat:1:MEAT:NONE:NONE:NONE] [HAS_MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD]
   [REAGENT:barrel:1:BARREL:NONE:NONE:NONE]
      [EMPTY]
      [PRESERVE_REAGENT]
      [DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [PRODUCT:100:3:LIQUID_MISC:NONE:GET_MATERIAL_FROM_REAGENT:meat:EXTRACT_BLOOD]
      [PRODUCT_TO_CONTAINER:barrel]
   [SKILL:BREWING]


modified muscle template (set to use blood, change to COOKING_BLOOD if this causes problems).  Only change is down at the bottom.
Code: [Select]

[MATERIAL_TEMPLATE:MUSCLE_TEMPLATE]
[STATE_COLOR:ALL_SOLID:MAUVE]
[STATE_NAME:ALL_SOLID:muscle]
[STATE_ADJ:ALL_SOLID:muscle]
[STATE_COLOR:LIQUID:MAUVE]
[STATE_NAME:LIQUID:n/a]
[STATE_ADJ:LIQUID:n/a]
[STATE_COLOR:GAS:MAUVE]
[STATE_NAME:GAS:n/a]
[STATE_ADJ:GAS:n/a]
[DISPLAY_COLOR:4:0:0]
[MATERIAL_VALUE:1]
[SPEC_HEAT:4181]
[IGNITE_POINT:10508]
[MELTING_POINT:NONE]
[BOILING_POINT:NONE]
[HEATDAM_POINT:10250]
[COLDDAM_POINT:9900]
[MAT_FIXED_TEMP:NONE]
[SOLID_DENSITY:1060]
[LIQUID_DENSITY:NONE]
[MOLAR_MASS:NONE]
[IMPACT_YIELD:10000]
[IMPACT_FRACTURE:10000]
[IMPACT_STRAIN_AT_YIELD:50000]
[COMPRESSIVE_YIELD:10000]
[COMPRESSIVE_FRACTURE:10000]
[COMPRESSIVE_STRAIN_AT_YIELD:50000]
[TENSILE_YIELD:10000]
[TENSILE_FRACTURE:10000]
[TENSILE_STRAIN_AT_YIELD:50000]
[TORSION_YIELD:10000]
[TORSION_FRACTURE:10000]
[TORSION_STRAIN_AT_YIELD:50000]
[SHEAR_YIELD:20000] used human skin
[SHEAR_FRACTURE:20000]
[SHEAR_STRAIN_AT_YIELD:50000]
[BENDING_YIELD:10000]
[BENDING_FRACTURE:10000]
[BENDING_STRAIN_AT_YIELD:50000]
[MAX_EDGE:0]
[ABSORPTION:100]
[IMPLIES_ANIMAL_KILL]
[ROTS]
[GENERATES_MIASMA]
[MEAT]
[BUTCHER_SPECIAL:MEAT:NONE]
[MEAT_NAME:NONE:meat:meat]
This lets the game know that the item can be eaten in various ways.
[EDIBLE_VERMIN]
[EDIBLE_COOKED]
[MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD:LOCAL_CREATURE_MAT:BLOOD] or COOKING_BLOOD

standard_materials (if you have to go the cooking_blood rout):
Code: [Select]
[BODY_DETAIL_PLAN:STANDARD_MATERIALS]
This command is just a shortcut for the similar lines (USE_MATERIAL_TEMPLATE|<token>|<template>) in a creature definition.
[ADD_MATERIAL:COOKING_BLOOD:BLOOD_TEMPLATE]
[ADD_MATERIAL:SKIN:SKIN_TEMPLATE]
[ADD_MATERIAL:FAT:FAT_TEMPLATE]
etc


EDIT:  if you add [EDIBLE_COOKED] to the BLOOD_TEMPLATE, you may be able to cook blood automatically at the kitchen. 
« Last Edit: February 19, 2011, 02:00:48 pm by D_E »
Logged
Mods I've done:
Zelda mod-mod, Beta in the Wild DF 47.04
Illithid Empire mod DF 31.25 (update canceled)
Spotter's Guide to Illithids (Genesis mod-mod) genesis 3.19a4 (update canceled)

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #18 on: February 19, 2011, 01:57:44 pm »

D_E: That's what I am testing now. I've added material reaction products to material templates. Give me a few moments and I will return with result.

It looks like you cannot extract submaterials from MEAT itself, but you should be able to read it through MATERIAL_REACTION_PRODUCT.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #19 on: February 19, 2011, 02:08:52 pm »

Okay here's what I did.

I've added
Code: [Select]
[REACTION_CLASS:BLOOD_EXTRACTION]
[MATERIAL_REACTION_PRODUCT:BLOOD_MAT:LOCAL_CREATURE_MAT:BLOOD]
To muscle, brain etc. materials.

I've made this:
Code: [Select]
[REACTION:PRESS_BLOOD]
   [NAME:press blood from bodyparts]
   [BUILDING:SCREW_PRESS:CUSTOM_T]
   [REAGENT:A:1:NONE:NONE:NONE:NONE]
[USE_BODY_COMPONENT]
[REACTION_CLASS:BLOOD_EXTRACTION]
[HAS_MATERIAL_REACTION_PRODUCT:BLOOD_MAT]
   [REAGENT:barrel:1:BARREL:NONE:NONE:NONE]
      [EMPTY]
      [PRESERVE_REAGENT]
      [DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [PRODUCT:100:3:LIQUID_MISC:NONE:GET_MATERIAL_FROM_REAGENT:meat:BLOOD_MAT]
      [PRODUCT_TO_CONTAINER:barrel]
   [SKILL:BREWING]

It still doesn't work... Makes "liquid[15]".

At the same time adding this to materials:
Code: [Select]
[REACTION_CLASS:CREMATION]
[MATERIAL_REACTION_PRODUCT:CREMATION_MAT:LOCAL_CREATURE_MAT:FAT]
and using this
Code: [Select]
[REACTION:CREMATE_BODY_KILN]
[NAME:cremate bodyparts]
[BUILDING:KILN:CUSTOM_SHIFT_B]
[REAGENT:A:2:NONE:NONE:NONE:NONE]
[USE_BODY_COMPONENT]
[REACTION_CLASS:CREMATION]
[HAS_MATERIAL_REACTION_PRODUCT:CREMATION_MAT]
[PRODUCT:100:1:BAR:NONE:ASH:NONE]
[PRODUCT_DIMENSION:150]
[PRODUCT:60:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:A:CREMATION_MAT]
[SKILL:SMELT]
makes fat just fine.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

silverskull39

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #20 on: February 19, 2011, 02:12:57 pm »

Success! D_E's suggestion worked and I now have peafowl blood. Now I just need to figure out how to make dwarves use a reaction to "Improve" their weapons by smearing it with blood. Should be relatively straight forward.
Logged
Quote
Quote
Quote
Dwarf fortress threads can sound so.... unethical
it would be unethical if this wasn't the bay12 forums
Bay12: A short, sturdy forum fond of !!science!! and derailment.
Quote
Now back to your regularly scheduled thread derailment.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #21 on: February 19, 2011, 02:19:19 pm »

Weird, it's the exact thing I did in the post above and it didn't work. I must've made a simple error.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #22 on: February 19, 2011, 02:23:51 pm »

Haha, I see it now. I have REAGENT:A but  I copied a product line from your original reaction, so it was looking for "meat" reagent, not "A". I'm glad it's solved.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

D_E

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #23 on: February 19, 2011, 02:25:02 pm »

Success! D_E's suggestion worked and I now have peafowl blood. Now I just need to figure out how to make dwarves use a reaction to "Improve" their weapons by smearing it with blood. Should be relatively straight forward.

As far as I know that is impossible (at least, having them smear it with liquid blood that can be used to transfer contaminants/syndromes is impossible). 

Which is to say, if you figure out how to make it work, please let me know!

Logged
Mods I've done:
Zelda mod-mod, Beta in the Wild DF 47.04
Illithid Empire mod DF 31.25 (update canceled)
Spotter's Guide to Illithids (Genesis mod-mod) genesis 3.19a4 (update canceled)

silverskull39

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #24 on: February 19, 2011, 02:31:36 pm »

Hrm.... new problem. for the blood smearing reaction what would the reagent be?

   [REAGENT:blood:1:EXTRACT_BLOOD:NONE:NONE:NONE]?

Success! D_E's suggestion worked and I now have peafowl blood. Now I just need to figure out how to make dwarves use a reaction to "Improve" their weapons by smearing it with blood. Should be relatively straight forward.

As far as I know that is impossible (at least, having them smear it with liquid blood that can be used to transfer contaminants/syndromes is impossible). 

Which is to say, if you figure out how to make it work, please let me know!



I'm not using it to try and transfer contaminants, I just thought it would be a dwarfy thing to do and actually be a good way to use blood barrels, though I may need to have a separate reaction to use the blood from caravans. But hey, if it works, bonus! Once I get it to work I'll move on to ichor. I also wanted a way to make "Rations" which are going to be what the jerky is. the jerky is going to be a reduced value food that, unspiced, has a very low value, but it will be a way to extend meat supplies.
Logged
Quote
Quote
Quote
Dwarf fortress threads can sound so.... unethical
it would be unethical if this wasn't the bay12 forums
Bay12: A short, sturdy forum fond of !!science!! and derailment.
Quote
Now back to your regularly scheduled thread derailment.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #25 on: February 19, 2011, 02:40:45 pm »

EXTRACT_BLOOD is just a "link" used to show what to take. It's still LIQUID_MISC.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

silverskull39

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #26 on: February 19, 2011, 02:46:51 pm »

so would I have to put [MATERIAL_REACTION_PRODUCT:BLOOD_SMEAR] or w/e in the blood material template and then use [HAS_MATERIAL_REACTION_PRODUCT:BLOOD_SMEAR]?
Logged
Quote
Quote
Quote
Dwarf fortress threads can sound so.... unethical
it would be unethical if this wasn't the bay12 forums
Bay12: A short, sturdy forum fond of !!science!! and derailment.
Quote
Now back to your regularly scheduled thread derailment.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #27 on: February 19, 2011, 02:52:08 pm »

Yep, it should work.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

silverskull39

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #28 on: February 19, 2011, 03:50:10 pm »

Well I've got two problems now. if the meat pressing reaction takes meat from a creature with ICHOR for blood, then it produces 'creature n/a
  • '. I thought I could solve that by adding    [MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD:LOCAL_CREATURE_MAT:ICHOR] to the meat definition, which worked for the most part... but it made ichor creatures the only meat it could accept. is there a way to make it produce ichor and blood correctly based on the meat without changing anything in every ichor producing creature?


Second problem is with the smearing reaction. It just shows up as red in the workshop even when I have a weapon and a barrel of blood.
Here's the code.
Spoiler (click to show/hide)

Any Ideas?
Logged
Quote
Quote
Quote
Dwarf fortress threads can sound so.... unethical
it would be unethical if this wasn't the bay12 forums
Bay12: A short, sturdy forum fond of !!science!! and derailment.
Quote
Now back to your regularly scheduled thread derailment.

D_E

  • Bay Watcher
    • View Profile
Re: Variable poisons simplifed. (Practile example of MATERIAL_FROM_REAGENT)
« Reply #29 on: February 19, 2011, 04:05:49 pm »

1)  The ichor thing will be somewhat awkward to fix.  You basically have two options:
i) Go through the raws and rename ICHOR to BLOOD.  Basically change:
Code: [Select]
[USE_MATERIAL_TEMPLATE:ICHOR:ICHOR_TEMPLATE]
[BLOOD:LOCAL_CREATURE_MAT:ICHOR:LIQUID]

to
Code: [Select]
[USE_MATERIAL_TEMPLATE:BLOOD:ICHOR_TEMPLATE]
[BLOOD:LOCAL_CREATURE_MAT:BLOOD:LIQUID]
wherever possible.

ii)Your second option is to put the following lines in every creature that uses ichor
Code: [Select]
[SELECT_MATERIAL:MUSCLE]
[MATERIAL_REACTION_PRODUCT:EXTRACT_BLOOD:LOCAL_CREATURE_MAT:ICHOR]
They must be somewhere after the call to STANDARD_MATERIALS.  At the end of the creature def would be fine.

2) 
i) shouldn't the improvement token just read [IMPROVEMENT:100:weapon:COVERED:GET_MATERIAL_FROM_REAGENT:blood]?

ii) Did you remember to add REACTION_CLASS:BLOOD to the BLOOD_TEMPLATE in material_templates_default?

ALSO!  Just to warn you, I'm pretty sure that the result of this reaction will be a weapon "covered in chunks of frozen blood."

EDIT:  as far as using all that blood, may I suggest black pudding?
« Last Edit: February 19, 2011, 04:08:21 pm by D_E »
Logged
Mods I've done:
Zelda mod-mod, Beta in the Wild DF 47.04
Illithid Empire mod DF 31.25 (update canceled)
Spotter's Guide to Illithids (Genesis mod-mod) genesis 3.19a4 (update canceled)
Pages: 1 [2] 3