Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What exactly defines whether an item has seeds  (Read 985 times)

Tachytaenius

  • Bay Watcher
    • View Profile
What exactly defines whether an item has seeds
« on: June 17, 2022, 01:34:47 pm »

I am not a DF plants expert but I am working on a script called cooking-drops-seeds, and I am trying to figure out what items should and shouldn't drop seeds exactly.
Currently the behaviour is:

For every item used in a prepare meal job, drop one seed of the appropriate material per stack_size if:
* The item is of type plant or plant growth
* The item has a material
* The material of the item is a plant
* The (plant) material of the item has seeds (use the listed material for the dropped seeds if so)

But this is broken for leaves etc (plant growth items (I believe)). What should the checks be? Should cooking a whole plant always drop seeds if the plant has any? Are STRUCTURAL plant growths always seed containers? I just don't know! Thanks for any info :)
Logged

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: What exactly defines whether an item has seeds
« Reply #1 on: June 17, 2022, 06:05:07 pm »

Are STRUCTURAL plant growths always seed containers?

I think all (or most) from plant_crops.txt and plant_standard.txt have [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED] in their STRUCTURAL material.

plant_garden.txt has it mostly on the materials of fruit and on their respective GROWTH there's [GROWTH_HAS_SEED].

Tachytaenius

  • Bay Watcher
    • View Profile
Re: What exactly defines whether an item has seeds
« Reply #2 on: June 18, 2022, 07:03:17 am »

So... I see [PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:plant:SEED_MAT] in the brew plant reaction's definition.
Does this mean a plant without seeds would produce seeds of material none?
And how does it know to be talking about the STRUCTURAL growth (or is it not a growth?)?
Logged

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: What exactly defines whether an item has seeds
« Reply #3 on: June 18, 2022, 11:09:22 am »

So... I see [PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:plant:SEED_MAT] in the brew plant reaction's definition.
Does this mean a plant without seeds would produce seeds of material none?
And how does it know to be talking about the STRUCTURAL growth (or is it not a growth?)?

If the plant or plant growth doesn't have SEED_MAT, it doesn't produce anything, afaik.

I'm not entirely sure, but how I've understood is that the STRUCTURAL of plants is used as their basic material (that is, the PLANT item uses it, not necessarily the PLANT_GROWTH).

For instance the 'brew drink from plant' reaction has the following reagent

Code: [Select]
[REAGENT:plant:1:PLANT:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:DRINK_MAT]
[UNROTTEN]

which means it'll use a PLANT item (which uses the STRUCTURAL material)

while the 'brew drink from fruit' reaction has
Code: [Select]
[REAGENT:plant:1:PLANT_GROWTH:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:DRINK_MAT]
[UNROTTEN]

meaning it'll use the material from a PLANT_GROWTH item (mainly fruit that usually uses FRUIT_TEMPLATE as a material template).

Both reactions have SEED_MAT as a product, so if a brewed material (plant or plant growth) has a material reaction product with it, the reaction will produce seeds in addition to drinks. If not, no seeds will be produced.

(...I'm pretty bad at explaining things, so sorry if that sounds confusing.)