Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Having trouble with a reaction  (Read 1516 times)

YAHG

  • Bay Watcher
    • View Profile
Having trouble with a reaction
« on: July 21, 2014, 04:38:55 pm »

I am trying to make farming yield less seeds and food but still require the same amount of planting.

I've been able to get the plump helmets to be inedible and I've gotten the reaction to execute on the screw press, but its only giving me seeds. I want it to give me the edible part of the plant.

If any of you folks could show me what I did wrong, I would appreciate it.

Thanks

Plant RAW

Spoiler (click to show/hide)

Reaction Raw

Spoiler (click to show/hide)

GavJ

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #1 on: July 21, 2014, 09:21:53 pm »

Not sure, but why are you using the super complicated "material_reaction_product" nonsense if your reaction is specific to plump helmets?
material reaction products are for when a reaction is generic to a whole class of things, yet you want it to inherit the variable name automatically.

If your reaction is, instead, only about plump helmets, just do:
[REAGENT:RAWHELMET:1:PLANT:NONE:PLANT_MAT:MUSHROOM_HELMET_PLUMP:STRUCTURAL] and
[PRODUCT:100:1:PLANT:NONE:PLANT_MAT:MUSHROOM_HELMET_PLUMP:MUSHROOM_STALK]
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Having trouble with a reaction
« Reply #2 on: July 22, 2014, 12:20:23 am »

looks to me you're getting [MATERIAL_REACTION_PRODUCT:EDIBLE_STALK:LOCAL_PLANT_MAT:MUSHROOM_STALK]
a bit mixed up because when I look at your reaction you have
 [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:MUSHROOM_STALK]

which you want

 [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:EDIBLE_STALK]
   [PRODUCT:25:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:SEED_MAT]

I was a tad confused with the RAWHELMET call because I didn't realize you were getting from the reagent
GavJ's method works aswell, but I see you want this for "all" your crops which I'm feeling a single 'generic' reaction would work for all types of farm able goods
SHUCK_MUSHROOMS
PROCESS_GRAINS
PREPARE_BERRIES_FRUITS
etc
etc
Logged

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #3 on: July 22, 2014, 01:29:49 am »

looks to me you're getting [MATERIAL_REACTION_PRODUCT:EDIBLE_STALK:LOCAL_PLANT_MAT:MUSHROOM_STALK]
a bit mixed up because when I look at your reaction you have
 [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:MUSHROOM_STALK]

which you want

 [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:EDIBLE_STALK]
   [PRODUCT:25:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:RAWHELMET:SEED_MAT]

I was a tad confused with the RAWHELMET call because I didn't realize you were getting from the reagent


Thank you, hopefully I can get it all up and working soon.

GavJ's method works aswell, but I see you want this for "all" your crops which I'm feeling a single 'generic' reaction would work for all types of farm able goods
SHUCK_MUSHROOMS
PROCESS_GRAINS
PREPARE_BERRIES_FRUITS
etc
etc

 Also and yes I needed a way to get in between the item that comes out of the plot and the items used in eat/brewing/etc so that you can influence:

Yield of farmland by area and farmer labor (do you have enough labor to put enough seeds in the ground with enough time for them to grow before winter etc.

What you do and do not get seeds back from, when you get them in the process, so you can edit what sort of ratios you need to save to replant next year.

Custom farming reactions also allow for the use of the use of the alchemist skill, which can be set via creature tokens to be stuck at any level you want, providing a labor sink for the farming process at any step in the chain. With the addition of plant growths it may also be possible to have set calender harvest times...

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Having trouble with a reaction
« Reply #4 on: July 22, 2014, 08:40:43 am »

also for ease sake all plants that you want this "additional" process to be on I suggest this on your crops/plants:
Code: (Plant) [Select]
      [MATERIAL_REACTION_PRODUCT:[color=orange]DRINK_MAT[/color]:LOCAL_PLANT_MAT:[color=yellow]DRINK[/color]]
      [MATERIAL_REACTION_PRODUCT:[color=orange]SEED_MAT[/color]:LOCAL_PLANT_MAT:[color=yellow]SEED[/color]]
      [MATERIAL_REACTION_PRODUCT:[color=orange]EDIBLE_MAT[/color]:LOCAL_PLANT_MAT:[color=yellow]EDIBLE[/color]]

   [USE_MATERIAL_TEMPLATE:[color=yellow]EDIBLE[/color]:STRUCTURAL_PLANT_TEMPLATE]
      [EDIBLE_VERMIN]
      [EDIBLE_COOKED]
      [STATE_NAME_ADJ:ALL_SOLID:plump helmet stalk]
      [STATE_NAME_ADJ:LIQUID:molten plump helmet stalk]
      [STATE_NAME_ADJ:GAS:plump helmet stalk vapor]

And

Code: (Reaction) [Select]
   [REAGENT:[color=green]farmGood[/color]:1:NONE:NONE:NONE:NONE] --- you can use lowercase for reagent names
      [HAS_MATERIAL_REACTION_PRODUCT:[color=orange]EDIBLE_MAT[/color]] --- now any plant containing [MATERIAL_REACTION_PRODUCT:[color=orange]EDIBLE_MAT[/color]:LOCAL_PLANT_MAT:[color=yellow]EDIBLE[/color]]

   [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:[color=green]farmGood[/color]:[color=orange]EDIBLE_MAT[/color]]
   [PRODUCT:25:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:[color=green]farmGood[/color]:[color=orange]SEED_MAT[/color]]

also I would suggest two lines to produce seeds, but instead of 25:25 you should make it 85:10

that way you have 85% chance of getting a seed with a 10% chance of getting another, that way sometimes a plant will not yield a seed at all, but still allow you to attempt to replant.
Of course could leave it as 25% because brewing returns seeds, making you manage do you need more seeds and booze, or do you need more crops to eat. Nice touch.
Logged

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #5 on: July 22, 2014, 11:30:16 am »

also for ease sake all plants that you want this "additional" process to be on I suggest this on your crops/plants:
Code: (Plant) [Select]
      [MATERIAL_REACTION_PRODUCT:[color=orange]DRINK_MAT[/color]:LOCAL_PLANT_MAT:[color=yellow]DRINK[/color]]


I assume this will give color to the 'unable to complete reaction due to:' dialog window that should be really helpful for error checking and people used to regular farming.

also I would suggest two lines to produce seeds, but instead of 25:25 you should make it 85:10

that way you have 85% chance of getting a seed with a 10% chance of getting another, that way sometimes a plant will not yield a seed at all, but still allow you to attempt to replant.
Of course could leave it as 25% because brewing returns seeds, making you manage do you need more seeds and booze, or do you need more crops to eat. Nice touch.

In my mind I am trying to make it so that dwarves both eat a lot more and how they eat has a different (than current) effect on your stock of plant-able seeds.

1: Currently, say if you go straight plump helmets and forbid them from being cooked and brewed, your food source is done for the game. Dwarves eating plants actually INCREASES the amount of seeds you can plant I want to see if its more !!FUN!! to play it the other way around so your "eating your seedcorn".

2: Dwarves do not eat very often so I am trying to make changes to the effective yield per seed planted. This will effectively make them require more farm output to have the same amount of sustenance. My goal is make it so that if your (farmers aren't very skilled / you do not fertilize your fields) you will eventually run out of seeds.

2b: It seems like it should also be pretty simple to make all domestic creatures milk-able (male and female) but have them not produce milk, but night-soil with a reaction tag on it so it can be made into fertilizer or even fuel (by doing it all in custom reactions we can make the yields something that works for whatever level of difficulty you are looking for)

2c: Making all animals require some form of food be that via [CANSPEAK] and [BONECARN] for cats and dogs etc. or [GRAZER:I] for everybody else.
Code: [Select]
!!Added FUN bonus I have been seeing reports that breaching the caverns to get grass on your underground plots can be tricky as the trees might destroy tiles and let invaders inside :)!!

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Having trouble with a reaction
« Reply #6 on: July 22, 2014, 12:28:25 pm »

oh no it won't give color in game, I just used the color features of the forum to highlight related variables. DF handles the colorization on it's own.

And seems like it's going to be an interesting modification I for sure would like to prevent farmed food spam (in about a year or two you can go from 50 to 700 plump helmets) and those like to eat up all the free barrels that I need for brewing.

So if I may i'd like to give suggestions and/or tips that you may like to use or not use.

2. Since seeds will be acquired from brewing only, and seed return on the "shucking" is low, they should give a bit more and maybe renaming the crops to a plural or group "Plump Helmet Cluster/Bushel" so you need a cluster/bushel to brew booze and get some seeds, or take that cluster/bushel and clean/shuck/process for 2-4 edible chunks per cluster/bushel but only have your 25% chance of 1 seed per cluster/bushel.

2b. Changing the milk-able to something to do with by-product of eating seems a tad weird, however you could make a new material in the creature "night soil" and have them LAYS_UNUSAL_EGG to make them lay "night soil <item>" that way females can be milked and cheese made but now they will use nest boxes to produce your fertilizer. You can go further and use syndrome triggers to make it a requirement that they lay eggs or else pain or berserk or death may happen.

2c. Grazer will work, altho the CANSPEAK/BONECARN combo like be a bit problem-matic, makes sense that cats and dogs need to eat meat (bonecarn seems more like a dog item, and carnivore for cats) which means players need to keep a supply of meat as well for their furry friends. But will they be able to eat? lacking GRASP parts (unless make special mouths for carnivorous pets), and in that case will dogs and cats carry meat from the stockpile, goto the dining hall and eat at a table? or will this end up everything starving? Give it a shot tho.
Logged

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #7 on: July 22, 2014, 03:59:38 pm »

It turns out 40.x gave us direct access to brewing reactions. I made all raw plants inedible and all drinks uncookable and changed the drink reactions to:


Spoiler (click to show/hide)


and this added


Spoiler (click to show/hide)


So far all my reactions seem to be working out as intended, thank you for all your help so far!


I don't know if it is balanced gameplay wise but with these settings using pure plump helmets:


2 Food + 4 Drink = 6 Plants per Dwarf*Season


So you should need


Plots Needed = P
Dwarf Count = D
Yield per tile = Y


P=6D/Y


but then you need spare plants to make seeds from to plant your next harvest.


I don't know what levels of yields you need mathematically to sustain long term farming, the math seems complicated to my brain and it seems like it would depend how much spare crops you were churning into seeds directly...


If yield is 2 or higher 12 tiles per DwarfSeason is sustainable. Skilled farm labor and effective layouts look to be VERY IMPORTANT with these settings (even with growdur:300).

GavJ

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #8 on: July 22, 2014, 04:16:37 pm »

Sure, but you still don't have various other seed producing things. Like direct eating (or do you? Does making the edible material on the plant a separate mUSHROOM_STALK stop dwarves from producing seeds when they eat it?) or milling into flour, or processing to some things at farmer workshops.

You can probably work around these, but don't forget about them is all. If you do, people can still build up a crapload of seeds by such methods and get around restrictions elsewhere.



In other news, I I suggest a less annoying and micromanaging way to accomplish the same thing you're trying to do here. Something like:
1) A reaction that combines X many plants into a "bushel of plump helmets" or whatever.
2) Use the bushel for reactions, which then yields only 1 seed for instance.

The result is that you still only get one seed for a stack of three plants, let's say, but unlike your method, it doesn't require careful balancing of two different contradictory job types by the overseer, but can instead just be set to automatic and forgotten about, since it's all an in-line process.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #9 on: July 22, 2014, 05:24:02 pm »

Sure, but you still don't have various other seed producing things. Like direct eating (or do you? Does making the edible material on the plant a separate mUSHROOM_STALK stop dwarves from producing seeds when they eat it?) or milling into flour, or processing to some things at farmer workshops.

You can probably work around these, but don't forget about them is all. If you do, people can still build up a crapload of seeds by such methods and get around restrictions elsewhere.



In other news, I I suggest a less annoying and micromanaging way to accomplish the same thing you're trying to do here. Something like:
1) A reaction that combines X many plants into a "bushel of plump helmets" or whatever.
2) Use the bushel for reactions, which then yields only 1 seed for instance.

The result is that you still only get one seed for a stack of three plants, let's say, but unlike your method, it doesn't require careful balancing of two different contradictory job types by the overseer, but can instead just be set to automatic and forgotten about, since it's all an in-line process.

Arg your right....

But at least there isn't too many holes left 8).

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #10 on: July 23, 2014, 12:40:36 am »

milling into flour, or processing to some things at farmer workshops.

You can probably work around these, but don't forget about them is all. If you do, people can still build up a crapload of seeds by such methods and get around restrictions elsewhere.

I made flour also inedible, same with sugar instead they are to be combined with booze into..

Bread:
Spoiler (click to show/hide)

Material for bread (plant cheese is unused AFIAK):
Spoiler (click to show/hide)

I was not able to get the bread to bake in the smelter it was canceling due not finding flour.

Local flour:
Spoiler (click to show/hide)

I didn't test longland or whip vine flour but I figure its an error in my syntax or maybe reaction classes need to be declared in the material template instead of local material template level.

Thank you.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Having trouble with a reaction
« Reply #11 on: July 23, 2014, 09:17:23 am »

FLOUR should be using [MATERIAL_REACTION_PRODUCT:BREAD_MAT:LOCAL_PLANT_MAT:BREAD]

if you want to use the GET_MATERIAL_FROM_REAGENT

so

Code: (plant) [Select]
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
      [STATE_NAME_ADJ:ALL_SOLID:dwarven wheat flour]
      [STATE_COLOR:ALL_SOLID:WHITE]
      [DISPLAY_COLOR:7:0:1]
      [MATERIAL_VALUE:20]
      [EDIBLE_VERMIN][MATERIAL_REACTION_PRODUCT:BREAD_MAT:LOCAL_PLANT_MAT:BREAD]
      [PREFIX:NONE]
   [MILL:LOCAL_PLANT_MAT:MILL]
Code: (reaction) [Select]
[REACTION:BREAD]
   [NAME:bake bread]
   [BUILDING:SMELTER:CUSTOM_B]   
   [REAGENT:FLOUR:1:NONE:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:BREAD_MAT]
   [REAGENT:SUGAR:1:NONE:NONE:NONE:NONE][REACTION_CLASS:SUGAR]
   [REAGENT:ALCOHOL:1:DRINK:NONE:NONE:NONE]
   [PRODUCT:100:3:BREAD:NONE:GET_MATERIAL_FROM_REAGENT:FLOUR:BREAD_MAT]
[FUEL]
[SKILL:COOK/COOKING]

Also sugar and flour is "bagged" so don't forget to add reagents for the containers else you will find that the reaction will never find it, and another issue is if the bags are put in barrels they won't be found because you can't dig that deep. Idk if Toady fixed that or not I think he knows about it as I think I saw that issue on the bug tracker.

EDIT:
and you need the container of the booze too, as it's in a barrel. I'm not home so I can't give an example.

EDIT2: updated reaction example
Code: [Select]
[REACTION:BREAD]
    [NAME:bake bread]
    [BUILDING:SMELTER:CUSTOM_B]   
    [REAGENT:FLOUR:1:NONE:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:BREAD_MAT]
[REAGENT:FLOUR_CONTAINER:1:NONE:NONE:NONE:NONE]
[CONTAINS:FLOUR]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
    [REAGENT:SUGAR:1:NONE:NONE:NONE:NONE][REACTION_CLASS:SUGAR]
[REAGENT:SUGAR_CONTAINER:1:NONE:NONE:NONE:NONE]
[CONTAINS:SUGAR]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
    [REAGENT:ALCOHOL:1:DRINK:NONE:NONE:NONE]
[REAGENT:ALCOHOL_CONTAINER:1:NONE:NONE:NONE:NONE]
[CONTAINS:ALCOHOL]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
    [PRODUCT:100:3:BREAD:NONE:GET_MATERIAL_FROM_REAGENT:FLOUR:BREAD_MAT]
[FUEL]
[SKILL:COOK]
« Last Edit: July 23, 2014, 02:43:37 pm by Hugo_The_Dwarf »
Logged

YAHG

  • Bay Watcher
    • View Profile
Re: Having trouble with a reaction
« Reply #12 on: August 19, 2014, 09:29:22 pm »

Thanks again for you help guys, I've managed to put together a toolpack that does most of the things we were gettting to work. I put extra effort into making it as unobtrusive as possible as per style etc. Seems to be an improvement to me and all the numbers are easily changeable to whatever you want etc.

And seems like it's going to be an interesting modification I for sure would like to prevent farmed food spam (in about a year or two you can go from 50 to 700 plump helmets) and those like to eat up all the free barrels that I need for brewing.


 :-[ Took me a while sir but I did my best  8). Hope you like it
« Last Edit: August 19, 2014, 09:30:54 pm by YAHG »
Logged