Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: GoblinCookie on August 27, 2016, 12:25:22 pm

Title: I have had enough of these reactions!
Post by: GoblinCookie on August 27, 2016, 12:25:22 pm
Code: [Select]
[REACTION:EXTRACT_GELATIN_FROM_CARTILAGE]
[NAME:extract gelatin from cartilage]
[BUILDING:KITCHEN:CUSTOM_A]
[REAGENT:A:150:GLOB:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:CARTILAGE]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:POWDER_MISC:INORGANIC:GELATIN_TEMPLATE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
[SKILL:COOK]

[REACTION:MAKE_JELLY]
[NAME:make fruit jelly]
[BUILDING:KITCHEN:CUSTOM_J]
[REAGENT:A:1:POWDER_MISC:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:GELATIN]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][CONTAINS:A][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:C:1:TOOL:ITEM_TOOL_JUG:NONE][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:D:1:PLANT_GROWTH:NONE:NONE:NONE][REACTION_CLASS:AM_FRUIT][UNROTTEN]
[PRODUCT:100:1:GLOB:INORGANIC:FRUIT_JELLY_TEMPLATE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:C]
[SKILL:COOK]

I cannot seem to get these reactions to work. My gnomes built a kitchen and butchered some animals, they seem to identify the reagents correctly as cartilage (I added a custom class to the material) and a bag.  However however much they add in no actual gelatin powder ever comes out, even though the product seems to be written perfectly, indeed pretty much identically to the powders in the game raws. 
Title: Re: I have had enough of these reactions!
Post by: scamtank on August 27, 2016, 12:59:04 pm
Multiply your product yields by 150 and see what happens.
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 27, 2016, 02:28:17 pm
Multiply your product yields by 150 and see what happens.

Still nothing happens.
Title: Re: I have had enough of these reactions!
Post by: Z49000 on August 27, 2016, 07:58:15 pm
Code: [Select]
[REACTION:EXTRACT_GELATIN_FROM_CARTILAGE]
[NAME:extract gelatin from cartilage]
[BUILDING:KITCHEN:CUSTOM_A]
[REAGENT:A:150:GLOB:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:CARTILAGE]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:POWDER_MISC:INORGANIC:GELATIN_TEMPLATE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
[SKILL:COOK]

[REACTION:MAKE_JELLY]
[NAME:make fruit jelly]
[BUILDING:KITCHEN:CUSTOM_J]
[REAGENT:A:1:POWDER_MISC:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:GELATIN]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][CONTAINS:A][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:C:1:TOOL:ITEM_TOOL_JUG:NONE][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:D:1:PLANT_GROWTH:NONE:NONE:NONE][REACTION_CLASS:AM_FRUIT][UNROTTEN]
[PRODUCT:100:1:GLOB:INORGANIC:FRUIT_JELLY_TEMPLATE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:C]
[SKILL:COOK]

I cannot seem to get these reactions to work. My gnomes built a kitchen and butchered some animals, they seem to identify the reagents correctly as cartilage (I added a custom class to the material) and a bag.  However however much they add in no actual gelatin powder ever comes out, even though the product seems to be written perfectly, indeed pretty much identically to the powders in the game raws.

Have you checked the errorlog? There should be something in there.
Title: Re: I have had enough of these reactions!
Post by: Grimlocke on August 28, 2016, 04:00:26 am
Your product materials seem to be trying to reference a template. That won't work, you need the material in any of the inorganic_* raws or in a plant or creature.
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 28, 2016, 09:42:42 am
Your product materials seem to be trying to reference a template. That won't work, you need the material in any of the inorganic_* raws or in a plant or creature.

I did that but still no product being produced and still no error log to tell me what is up.  >:( >:(


This is the inorganic.
Code: [Select]
[INORGANIC:GELATIN]
[USE_MATERIAL_TEMPLATE:GELATIN_TEMPLATE]
[POWDER_MISC]

[INORGANIC:FRUIT_JELLY]
[USE_MATERIAL_TEMPLATE:FRUIT_JELLY_TEMPLATE]
[POWDER_MISC]


This are reactions as they presently stand.
Code: [Select]
[REACTION:EXTRACT_GELATIN_FROM_CARTILAGE]
[NAME:extract gelatin from cartilage]
[BUILDING:KITCHEN:CUSTOM_A]
[REAGENT:A:150:GLOB:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:CARTILAGE]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:POWDER_MISC:INORGANIC:GELATIN][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
[SKILL:COOK]

[REACTION:MAKE_JELLY]
[NAME:make fruit jelly]
[BUILDING:KITCHEN:CUSTOM_J]
[REAGENT:A:1:POWDER_MISC:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:GELATIN]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][CONTAINS:A][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:C:1:TOOL:ITEM_TOOL_JUG:NONE][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:D:1:PLANT_GROWTH:NONE:NONE:NONE][REACTION_CLASS:AM_FRUIT][UNROTTEN]
[PRODUCT:100:1:GLOB:INORGANIC:FRUIT_JELLY][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:C]
[SKILL:COOK]
Title: Re: I have had enough of these reactions!
Post by: scamtank on August 28, 2016, 10:41:05 am
Oh, you're also missing the item subtypes. Even if the subtype is NONE (like it usually is), you still need to stick them after the type itself. POWDER_MISC:NONE:INORGANIC:GELATIN for example.
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 28, 2016, 03:00:25 pm
Oh, you're also missing the item subtypes. Even if the subtype is NONE (like it usually is), you still need to stick them after the type itself. POWDER_MISC:NONE:INORGANIC:GELATIN for example.

Well you advice worked in the sense that the reaction now produces something, it produces MAGMA!!!  The magma then proceeds to melt through the bag it is in and set fire to everything around it.  The only explanation I can come to is that the output is being produced but is being produced at a temperature that is sufficient to melt the 'rock' that is the material that I am producing.  However this makes no sense because there literally is no melting point defined in the material template, so is what is going on some kind of default state? There is no liquid state for the material but since it is an inorganic hence rock it produces generic magma instead. 

Here is the material template for what is supposed to be produced. 

Code: [Select]
[MATERIAL_TEMPLATE:GELATIN_TEMPLATE]
[STATE_COLOR:ALL_SOLID:WHITE]
[STATE_NAME:ALL_SOLID:gelatin]
[STATE_ADJ:ALL_SOLID:gelatinous]
[STATE_COLOR:LIQUID:WHITE]
[STATE_NAME:LIQUID:n/a]
[STATE_ADJ:LIQUID:n/a]
[STATE_COLOR:GAS:WHITE]
[STATE_NAME:GAS:n/a]
[STATE_ADJ:GAS:n/a]
[DISPLAY_COLOR:7:0:1]
    [MATERIAL_VALUE:2]
[SPEC_HEAT:420]
[IGNITE_POINT:10508]
[MELTING_POINT:NONE]
[BOILING_POINT:NONE]
[HEATDAM_POINT:10250]
[COLDDAM_POINT:9900]
[MAT_FIXED_TEMP:NONE]
[SOLID_DENSITY:500]
[LIQUID_DENSITY:NONE]
[MOLAR_MASS:NONE]
[IMPACT_YIELD:10000]
[IMPACT_FRACTURE:10000]
[IMPACT_STRAIN_AT_YIELD:25000]
[COMPRESSIVE_YIELD:10000]
[COMPRESSIVE_FRACTURE:10000]
[COMPRESSIVE_STRAIN_AT_YIELD:25000]
[TENSILE_YIELD:10000]
[TENSILE_FRACTURE:10000]
[TENSILE_STRAIN_AT_YIELD:25000]
[TORSION_YIELD:10000]
[TORSION_FRACTURE:10000]
[TORSION_STRAIN_AT_YIELD:25000]
[SHEAR_YIELD:30000] from net someplace
[SHEAR_FRACTURE:30000]
[SHEAR_STRAIN_AT_YIELD:25000]
[BENDING_YIELD:10000]
[BENDING_FRACTURE:10000]
[BENDING_STRAIN_AT_YIELD:25000]
[MAX_EDGE:0]
[ABSORPTION:100]
[IMPLIES_ANIMAL_KILL]
[EDIBLE_COOKED]
[REACTION_CLASS:GELATIN]
Title: Re: I have had enough of these reactions!
Post by: Z49000 on August 28, 2016, 03:56:54 pm
Oh, you're also missing the item subtypes. Even if the subtype is NONE (like it usually is), you still need to stick them after the type itself. POWDER_MISC:NONE:INORGANIC:GELATIN for example.

Well you advice worked in the sense that the reaction now produces something, it produces MAGMA!!!  The magma then proceeds to melt through the bag it is in and set fire to everything around it.  The only explanation I can come to is that the output is being produced but is being produced at a temperature that is sufficient to melt the 'rock' that is the material that I am producing.  However this makes no sense because there literally is no melting point defined in the material template, so is what is going on some kind of default state? There is no liquid state for the material but since it is an inorganic hence rock it produces generic magma instead. 

Here is the material template for what is supposed to be produced. 

Code: [Select]
[MATERIAL_TEMPLATE:GELATIN_TEMPLATE]
[STATE_COLOR:ALL_SOLID:WHITE]
[STATE_NAME:ALL_SOLID:gelatin]
[STATE_ADJ:ALL_SOLID:gelatinous]
[STATE_COLOR:LIQUID:WHITE]
[STATE_NAME:LIQUID:n/a]
[STATE_ADJ:LIQUID:n/a]
[STATE_COLOR:GAS:WHITE]
[STATE_NAME:GAS:n/a]
[STATE_ADJ:GAS:n/a]
[DISPLAY_COLOR:7:0:1]
    [MATERIAL_VALUE:2]
[SPEC_HEAT:420]
[IGNITE_POINT:10508]
[MELTING_POINT:NONE]
[BOILING_POINT:NONE]
[HEATDAM_POINT:10250]
[COLDDAM_POINT:9900]
[MAT_FIXED_TEMP:NONE]
[SOLID_DENSITY:500]
[LIQUID_DENSITY:NONE]
[MOLAR_MASS:NONE]
[IMPACT_YIELD:10000]
[IMPACT_FRACTURE:10000]
[IMPACT_STRAIN_AT_YIELD:25000]
[COMPRESSIVE_YIELD:10000]
[COMPRESSIVE_FRACTURE:10000]
[COMPRESSIVE_STRAIN_AT_YIELD:25000]
[TENSILE_YIELD:10000]
[TENSILE_FRACTURE:10000]
[TENSILE_STRAIN_AT_YIELD:25000]
[TORSION_YIELD:10000]
[TORSION_FRACTURE:10000]
[TORSION_STRAIN_AT_YIELD:25000]
[SHEAR_YIELD:30000] from net someplace
[SHEAR_FRACTURE:30000]
[SHEAR_STRAIN_AT_YIELD:25000]
[BENDING_YIELD:10000]
[BENDING_FRACTURE:10000]
[BENDING_STRAIN_AT_YIELD:25000]
[MAX_EDGE:0]
[ABSORPTION:100]
[IMPLIES_ANIMAL_KILL]
[EDIBLE_COOKED]
[REACTION_CLASS:GELATIN]

From my knowledge, magma is what the game creates when it can't find a material.
Title: Re: I have had enough of these reactions!
Post by: Halnoth on August 28, 2016, 04:11:31 pm
If you are getting magma then the game does not recognize the product material you are referencing. So here are some things you should know/check:

1. You have to regen the world if you add new materials. So, if you added your inorganic gelatin after the fact then you will have to gen a new world.

2. Make sure you have formatted the raw file where you placed your new materials and inorganic entries. For DF to recognize the file both the name of the file and the header need to conform to the format.

I am almost certain this is a material formatting issue.
Title: Re: I have had enough of these reactions!
Post by: Putnam on August 28, 2016, 06:35:06 pm
Um, wow.

Okay, the item advice was already given. Good. That... probably shouldn't have taken five posts, tbh.

The problem you're having now is that you cannot reference templates in a reaction. You are trying to reference a template as an inorganic, which is wrong--you can only reference INORGANICs as INORGANIC. You actually need to make an INORGANIC using the FRUIT_JELLY_TEMPLATE template.

Note that this was brought up earlier in the topic:

Your product materials seem to be trying to reference a template. That won't work, you need the material in any of the inorganic_* raws or in a plant or creature.
Title: Re: I have had enough of these reactions!
Post by: Grimlocke on August 29, 2016, 12:16:30 am
Oh whoops, completely read over the lack of item subtype.  ::)

I should probably add that its not really necessary to make a template for each material, they are mostly intended so that when you make lots and lots of similar materials.
Title: Re: I have had enough of these reactions!
Post by: Halnoth on August 29, 2016, 12:43:07 am
Um, wow.

Okay, the item advice was already given. Good. That... probably shouldn't have taken five posts, tbh.


Well ya but the OP has quite a few things wrong. Modding can be a bit hard at first, the wiki is not all that helpful when you don't understand how everything fits together. I still think one of the things I mentioned is part of the issue since the OP claimed to have tried the suggestions. Most likely the OP has a file name formatting error or has tried to apply new inorganics to an existing world.
Title: Re: I have had enough of these reactions!
Post by: Putnam on August 29, 2016, 12:57:54 am
Um, wow.

Okay, the item advice was already given. Good. That... probably shouldn't have taken five posts, tbh.


Well ya but the OP has quite a few things wrong. Modding can be a bit hard at first, the wiki is not all that helpful when you don't understand how everything fits together. I still think one of the things I mentioned is part of the issue since the OP claimed to have tried the suggestions. Most likely the OP has a file name formatting error or has tried to apply new inorganics to an existing world.

Need to fix things in order, though. That would be:

1. Item subtype
2. Making the INORGANIC reference an actual INORGANIC instead of a template
3. File formatting issues
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 29, 2016, 11:04:46 am
Well ya but the OP has quite a few things wrong. Modding can be a bit hard at first, the wiki is not all that helpful when you don't understand how everything fits together. I still think one of the things I mentioned is part of the issue since the OP claimed to have tried the suggestions. Most likely the OP has a file name formatting error or has tried to apply new inorganics to an existing world.

I am trying to introduce new inorganics to an existing world.  All along I was using the same savegame and changing around the raw files because for reactions this works since the entity loads up the reactions and it saves the bother of having to gen a new world.  I then added in the new inorganic file to the raws with the additional entries when I found out that I could not simply reference the template directly but it would seem that inorganic file changes work like entity file changes, the save file does not reference the raws but stores the data separately without any referencing of the raws once the generation has begun. 

It should not be too much of a bother to start a new medium world for testing purposes when rock gnomes are as common as dirt as they are the moment in my mod.   ;)
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 29, 2016, 12:22:15 pm
 :D :D :D :D 8) 8) 8) 8)

I seems I have finally done it!  Thanks to everyone that helped me out in this thread.  The final form of the reactions are.
Code: [Select]
[REACTION:EXTRACT_GELATIN_FROM_CARTILAGE]
[NAME:extract gelatin from cartilage]
[BUILDING:KITCHEN:CUSTOM_A]
[REAGENT:A:150:GLOB:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:CARTILAGE]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:POWDER_MISC:NONE:INORGANIC:GELATIN][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
[SKILL:COOK]

[REACTION:MAKE_JELLY]
[NAME:make fruit jelly]
[BUILDING:KITCHEN:CUSTOM_J]
[REAGENT:A:1:POWDER_MISC:NONE:NONE:NONE][UNROTTEN][REACTION_CLASS:GELATIN]
[REAGENT:B:1:BOX:NONE:NONE:NONE][BAG][CONTAINS:A][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:C:1:TOOL:ITEM_TOOL_JUG:NONE:NONE][EMPTY][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:D:1:PLANT_GROWTH:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:DRINK_MAT][UNROTTEN] *Use drink mat to save time
[PRODUCT:100:1:GLOB:NONE:INORGANIC:FRUIT_JELLY][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:C]
[SKILL:COOK]

The fruit jelly once made remains inside the jug that is used to make it.  I tested to make sure that it can be used in cooking and I ended up with a stack of grape and fruit jelly biscuit (the fruit jelly is also grape).  I had some difficulty with the whole buggy way that the fruit always arrives in bags and you have to mass dump the fruit in order to make use of them.
Title: Re: I have had enough of these reactions!
Post by: Halnoth on August 29, 2016, 03:51:51 pm
I had some difficulty with the whole buggy way that the fruit always arrives in bags and you have to mass dump the fruit in order to make use of them.

Can't you just add a bag line to the reagents? In this case it would say CONTAINS:D
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 30, 2016, 10:46:41 am
Can't you just add a bag line to the reagents? In this case it would say CONTAINS:D

That would mean that the fruit would have to be in a bag for the fruit reagents to work.  Dwarves do not put fruit in bags during the game, they put them in barrels but at embark they always arrive in bags if you opt to take fruit with you.  It is one time issue that had me thinking that there was something wrong when there is not. 
Title: Re: I have had enough of these reactions!
Post by: Quietust on August 31, 2016, 08:55:12 am
Given that fruits do not need to be stored in bags, one would expect reactions to simply take them out of the bag when necessary (just like with barrels) - if they do not, then it is a bug which needs to be reported (if it hasn't already been).
Title: Re: I have had enough of these reactions!
Post by: GoblinCookie on August 31, 2016, 10:48:28 am
Given that fruits do not need to be stored in bags, one would expect reactions to simply take them out of the bag when necessary (just like with barrels) - if they do not, then it is a bug which needs to be reported (if it hasn't already been).

Bags do not work the same way as barrels.  Bags *are* an item that is modified by having a connection made to a second item, barrels are two items with a relationship to eachother.  This means you have to say in a reaction that you are using a bag that contains X while with barrels/bins you can simply define the items directly.  I would not say it is a bug as such, more how the game works, the bug is that fruit arrives in bags rather than barrels.
Title: Re: I have had enough of these reactions!
Post by: Quietust on August 31, 2016, 09:01:07 pm
Both bags and barrels (and all other containers) function exactly the same in-game - they report a container capacity (either hardcoded or derived from the item_tool raws), they have references to their contents (general_ref_contains_itemst), and their contents have references back to the container itself (general_ref_contained_in_itemst).

Any behavioral differences between them are entirely due to the way jobs handle them and the way they (and their contents) are categorized for selection by jobs, and custom reactions don't necessarily follow all of those rules. Custom reactions can definitely use seeds that are stored in bags without requesting the bags themselves (I just checked), but plant growths might be treated differently, possibly an attempt to keep quarry bush leaves inside their bags (and similar scenarios).
Title: Re: I have had enough of these reactions!
Post by: Halnoth on September 01, 2016, 09:10:28 pm
Ya bags are somehow seen differently in game. As an example, in my mod I have various dye types. For some reason when you q manager jobs and set constraints the manager cannot look inside of bags in order to obtain an accurate count of the reagent. However, oddly by making the dye edible the manager can look inside the bag and accurately count the items. This doesnt seem to happen with barrels. So, bags do seem to have some weirdness.