Bay 12 Games Forum

Please login or register.

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

Author Topic: Producing oil from tree seeds: trouble with milling  (Read 1435 times)

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #15 on: April 22, 2024, 10:58:15 am »

Ok so with nested SELECTs and SELECT_MATERIAL for seeds the problem of duplicate seeds really is fixed.  However, the behaviour I get now is that I can't mill any of them instantiated by dfhack, neither with "createitem SEEDS" nor with "createitem PLANT_GROWTH", so I can't even test anything in my mod this way. But as noted before, this is also true of vanilla rock nuts created by dfhack, so I'm reserving judgement until I test it with organic, locally sourced seeds.

What exact command are you using to create the seeds? There are multiple ways you can get it wrong which will result in items that "look" like seeds but won't actually work correctly.

Any command of the form

Code: [Select]
    createitem SEEDS BUSH_QUARRY 1
creates seeds I can't mill, no matter for which plant.

Any command of the form

Code: [Select]
    createitem PLANT_GROWTH ALMOND:NUT 1
creates functional seeds, but this is only usable for plants where the seeds are also plant growths (so no rock nuts or non-nut tree seeds).
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Producing oil from tree seeds: trouble with milling
« Reply #16 on: April 22, 2024, 11:19:06 am »

Any command of the form

Code: [Select]
    createitem SEEDS BUSH_QUARRY 1
creates seeds I can't mill, no matter for which plant.

I'm surprised that works at all - I would've expected an "Unrecognized material!" error from that. Looking closer, there seems to be a special case in DFHack's Material parser which returns the STRUCTURAL material in that case, which is wrong here.

What you need to type is "createitem SEEDS PLANT_MAT:BUSH_QUARRY:SEED".
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Ziusudra

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #17 on: April 22, 2024, 02:06:30 pm »

It's one of the few DFHack tools to get it's own wiki page; https://dwarffortresswiki.org/index.php/Utility:DFHack/createitem#Seeds
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #18 on: April 23, 2024, 11:28:04 am »

I'm surprised that works at all - I would've expected an "Unrecognized material!" error from that. Looking closer, there seems to be a special case in DFHack's Material parser which returns the STRUCTURAL material in that case, which is wrong here.

What you need to type is "createitem SEEDS PLANT_MAT:BUSH_QUARRY:SEED".

Thank you so much! I had seen the wiki page but somehow missed the example about seeds.  Yeah with this the rock nuts are "functional" and it will make testing my mod a lot easier.

Alas, I can't seem to make the SELECT_PLANT > SELECT_MATERIAL:SEED version of my oil-bearing seeds work.  I'll fiddle with it a bit more before giving up and reverting to copy-pasting the raws for the whole trees, which is how the other plant mods do things.
Logged

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #19 on: April 23, 2024, 11:51:46 am »

Here's an example of a nonfunctional definition, in full:

Code: [Select]
[SELECT_PLANT:CHERRY] Prunus avium
        [USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:frozen cherry seed oil]
                [STATE_NAME_ADJ:LIQUID:cherry seed oil]
                [STATE_NAME_ADJ:GAS:boiling cherry seed oil]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
                [EDIBLE_COOKED]
        [USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:cherry seed oil soap]
                [STATE_NAME_ADJ:LIQUID:melted cherry seed oil soap]
                [STATE_NAME_ADJ:GAS:n/a]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
                [STATE_COLOR:ALL_SOLID:MOSS_GREEN]
                [STATE_COLOR:LIQUID:MOSS_GREEN]
                [STATE_COLOR:GAS:MOSS_GREEN]
                [DISPLAY_COLOR:2:0:1] light green
        [SELECT_MATERIAL:SEED]
                [STATE_NAME_ADJ:ALL_SOLID:cherry pit]
                [STATE_NAME_ADJ:SOLID_PASTE:cherry pit paste]
                [STATE_NAME_ADJ:SOLID_PRESSED:cherry pit press cake]
                [PREFIX:NONE]
                [MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
                [STOCKPILE_GLOB_PASTE]
                [STOCKPILE_GLOB_PRESSED]
        [LOG_CURRENT_ENTRY]

I've added the oil and soap materials (not present in the raws) and I SELECT_MATERIAL'd the seed, modelling on other oil-bearing seeds.  This results in the following log:

Code: [Select]
--- Logging Plant CHERRY---
[NAME:cherry tree]
[NAME_PLURAL:cherry trees]
[ADJ:cherry tree]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:cherry wood]
[STATE_ADJ:ALL_SOLID:cherry wood]
[PREFIX:NONE]
[SOLID_DENSITY:425]
[STATE_COLOR:ALL_SOLID:GOLD]
[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:frozen cherry wine]
[STATE_NAME_ADJ:LIQUID:cherry wine]
[STATE_NAME_ADJ:GAS:boiling cherry wine]
[STATE_COLOR:ALL:CARMINE]
[MATERIAL_VALUE:2]
[DISPLAY_COLOR:6:0:0]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[PREFIX:NONE]
[DRINK:LOCAL_PLANT_MAT:DRINK]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_COLOR:ALL:DARK_OLIVE]
[DISPLAY_COLOR:2:0:0]
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
[STATE_COLOR:ALL:LAVENDER_BLUSH]
[DISPLAY_COLOR:7:0:1]
[USE_MATERIAL_TEMPLATE:FRUIT:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:BURNT_UMBER]
[DISPLAY_COLOR:4:0:1]
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[STOCKPILE_PLANT_GROWTH]
[MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[MATERIAL_VALUE:1]
[EDIBLE_VERMIN]
[SEED:cherry pit:cherry pits:6:0:0:LOCAL_PLANT_MAT:SEED]
[TREE:LOCAL_PLANT_MAT:WOOD]
[TREE_TILE:5]
[TRUNK_PERIOD:10]
[HEAVY_BRANCH_DENSITY:25]
[BRANCH_DENSITY:50]
[MAX_TRUNK_HEIGHT:8]
[HEAVY_BRANCH_RADIUS:1]
[BRANCH_RADIUS:2]
[TRUNK_BRANCHING:2]
[MAX_TRUNK_DIAMETER:1]
[TRUNK_WIDTH_PERIOD:200]
[ROOT_DENSITY:5]
[ROOT_RADIUS:3]
[STANDARD_TILE_NAMES]
[PREFSTRING:fruit]
[PREFSTRING:blossoms]
[DRY]
[BIOME:ANY_TEMPERATE]
[SAPLING]
[GROWTH:LEAVES]
[GROWTH_NAME:cherry leaf:cherry leaves]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:BRANCHES_AND_TWIGS]
[GROWTH_HOST_TILE:SAPLING]
[GROWTH_TIMING:0:300000]
[GROWTH_PRINT:0:6:2:0:0:0:209999:1]
[GROWTH_PRINT:0:6:6:0:1:210000:239999:1]
[GROWTH_PRINT:0:6:4:0:1:240000:269999:1]
[GROWTH_PRINT:0:6:4:0:0:270000:300000:1]
[GROWTH_DROPS_OFF]
[GROWTH:FLOWERS]
[GROWTH_NAME:cherry flower:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:BRANCHES_AND_TWIGS]
[GROWTH_TIMING:60000:119999]
[GROWTH_PRINT:5:5:7:0:1:60000:119999:2]
[GROWTH_DROPS_OFF]
[GROWTH:FRUIT]
[GROWTH_NAME:cherry:cherries]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FRUIT]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:BRANCHES_AND_TWIGS]
[GROWTH_TIMING:120000:200000]
[GROWTH_DROPS_OFF_NO_CLOUD]
[GROWTH_PRINT:'%':'%':4:0:1:120000:200000:3]
[GROWTH_HAS_SEED]
[USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:frozen cherry seed oil]
[STATE_NAME_ADJ:LIQUID:cherry seed oil]
[STATE_NAME_ADJ:GAS:boiling cherry seed oil]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[EDIBLE_COOKED]
[USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:cherry seed oil soap]
[STATE_NAME_ADJ:LIQUID:melted cherry seed oil soap]
[STATE_NAME_ADJ:GAS:n/a]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[STATE_COLOR:ALL_SOLID:MOSS_GREEN]
[STATE_COLOR:LIQUID:MOSS_GREEN]
[STATE_COLOR:GAS:MOSS_GREEN]
[DISPLAY_COLOR:2:0:1]
[SELECT_MATERIAL:SEED]
[STATE_NAME_ADJ:ALL_SOLID:cherry pit]
[STATE_NAME_ADJ:SOLID_PASTE:cherry pit paste]
[STATE_NAME_ADJ:SOLID_PRESSED:cherry pit press cake]
[PREFIX:NONE]
[MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
[STOCKPILE_GLOB_PASTE]
[STOCKPILE_GLOB_PRESSED]

So it seems like the SELECT_MATERIAL:SEED command is being read OK and tacked at the end of the builtin commands, but despite the LOCAL_PLANT_MAT:OIL entry, they still don't show up to me on a quern's "mill seed" reaction.

This goes both for cherry seeds created with "createitem SEEDS PLANT_MAT:CHERRY:SEED 1", and found "organically" through playing.  By contrast, the createitem command works for rock nuts or olive fruits.
Logged

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #20 on: April 23, 2024, 12:09:18 pm »

After a few more tests:

 - SELECT_PLANT: followed by SELECT_MATERIAL:SEED as in the example above didn't work.
 - [CUT_PLANT:CHERRY], copy-pasting the entire tree definition, adding the extra lines to [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE], and adding the oil+soap materials works.
 - Without knowing what I'm doing, I then tried SELECT_PLANT:CHERRY, followed by CUT_MATERIAL:SEED, and then the entire  [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE] (copied from the vanilla raws plus my new lines).  This also worked, and needs a lot less duplication than copying the entire tree.

Now I'm wondering if anything was wrong with my attempt to use SELECT_MATERIAL.


Logged

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #21 on: April 24, 2024, 01:44:53 pm »

On today's patch notes:

Quote
SELECT_GROWTH and SELECT_MATERIAL available in plant modding

holy frig did y'all add this because of this thread?? whether that's the case or not thank you :D

edit: it works! the examples below are all pure SELECTs, no CUTs used and no token duplication at all!

« Last Edit: April 24, 2024, 02:36:36 pm by elilla »
Logged
Pages: 1 [2]