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 680 times)

elilla

  • Bay Watcher
    • View Profile
Producing oil from tree seeds: trouble with milling
« on: April 17, 2024, 04:38:21 pm »

I'm trying to make my first mod.  My idea is to make some useless tree seeds less useless by letting them produce oil.  (I know there's a bunch of comprehensive plant mods but I wanted to try my hand at something minimal).

First I tried was almond, and by using SELECT_PLANT and copy-pasting some stuff from other plants, I did this:

Code: [Select]
[SELECT_PLANT:ALMOND] Prunus dulcis
        [USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:frozen almond oil]
                [STATE_NAME_ADJ:LIQUID:almond oil]
                [STATE_NAME_ADJ:GAS:boiling almond oil]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
                [EDIBLE_COOKED]
        [USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:almond oil soap]
                [STATE_NAME_ADJ:LIQUID:melted almond oil soap]
                [STATE_NAME_ADJ:GAS:n/a]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
        [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
                [STATE_COLOR:ALL:BROWN]
                [DISPLAY_COLOR:6:0:0]
                [MATERIAL_VALUE:1]
                [EDIBLE_VERMIN]
                [EDIBLE_RAW]
                [EDIBLE_COOKED]
                [STATE_NAME_ADJ:ALL_SOLID:almond]
                [STATE_NAME_ADJ:SOLID_PASTE:almond paste]
                [STATE_NAME_ADJ:SOLID_PRESSED:almond press cake]
                [PREFIX:NONE]
                [MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
                [STOCKPILE_GLOB_PASTE]
                [STOCKPILE_GLOB_PRESSED]

The PLANT_OIL_TEMPLATE and PLANT_SOAP_TEMPLATE are added to vanilla, while SEED_TEMPLATE replaces the original (so I duplicated all entries of the original SEED_TEMPLATE call, up to EDIBLE_COOKED, and added the extra stuff oil-related stuff.)

This worked! I tried avocados—from fruit, not seed—and even fooled around a bit by making avocado soap green.  All working.

Encouraged, I went down the alphabetical list for apricots:

Code: [Select]
[SELECT_PLANT:APRICOT] Prunus armeniaca
        [USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:frozen apricot oil]
                [STATE_NAME_ADJ:LIQUID:apricot oil] called "oil of almond" in real life
                [STATE_NAME_ADJ:GAS:boiling apricot oil]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
                [EDIBLE_COOKED]
        [USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
                [STATE_NAME_ADJ:ALL_SOLID:apricot oil soap]
                [STATE_NAME_ADJ:LIQUID:apricot oil soap]
                [STATE_NAME_ADJ:GAS:n/a]
                [PREFIX:NONE]
                [MATERIAL_VALUE:5]
        [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
                [MATERIAL_VALUE:1]
                [EDIBLE_VERMIN]
                [STATE_NAME_ADJ:ALL_SOLID:apricot pit]
                [STATE_NAME_ADJ:SOLID_PASTE:apricot kernel paste]
                [STATE_NAME_ADJ:SOLID_PRESSED:apricot kernel press cake]
                [PREFIX:NONE]
                [MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
                [STOCKPILE_GLOB_PASTE]
                [STOCKPILE_GLOB_PRESSED]

abjection! failure!  I do on dfhack `createitem SEEDS APRICOT 10`, build a quern, the option to mill oil-bearing seeds doesn't come up.  If I use the `gui/create-item` interactive menu, I can see apricot oil and apricot oil soap now exist in the universe.  But I can't mill the seeds.

As you can see, I basically copy-pasted the working SELECT_PLANT from almonds, but it didn't work.  So I'm guessing it's something to do with the definitions of the vanilla plants?  Does it have to do with how, for almonds, seeds are edible "nuts"? or how they're plant growths?

The [REACTION:MILL_SEEDS_NUTS_TO_PASTE] entry has this:

Code: [Select]
        [REAGENT:seeds:1:SEEDS:NONE:NONE:NONE][UNROTTEN]
                [HAS_MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT] to ensure only worthwhile seeds get used

but we have the PRESS_LIQUID_MAT on the modded apricot seeds, and it's showing on the logs/current_entry.txt just like the working almonds.
« Last Edit: April 17, 2024, 04:43:58 pm by elilla »
Logged

aradar

  • Bay Watcher
  • Legendary bullshitter
    • View Profile
    • my steam workshop
Re: Producing oil from tree seeds: trouble with milling
« Reply #1 on: April 18, 2024, 07:54:46 am »

This is a silly question because I'm like mad confused at why it's not working everything you're doing looks like it should work you have empty containers for the oil right LOL???

For curiosity sake I added this quickly to one of my mods because I do a lot of work with plant stuff and it's showing up in the stockpiles, I don't have any apricots yet I don't have dfhack or whatever so I'm waiting for apricots to grow so I can see if I can get them in a mill

I have a group of goblins on standby standing next to an apricot tree waiting for it to make apricots if they don't kill each other before it makes apricots I'll have the answer for you here soon

Had a small setback myself your question led me to find out that I was missing important things in my own mod I couldn't't harvest fruit but I can now ♥️♥️ waiting on the apricots again have an answer soon

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #2 on: April 18, 2024, 08:32:06 am »

The materials and such look correct, but I'm not at all familiar with how the new modding stuff with SELECT_PLANT etc works. Maybe try cutting the vanilla almond tree away with CUT_PLANT and make a new version of the whole almond tree and see if that works?

aradar

  • Bay Watcher
  • Legendary bullshitter
    • View Profile
    • my steam workshop
Re: Producing oil from tree seeds: trouble with milling
« Reply #3 on: April 18, 2024, 10:18:54 am »

Spoiler (click to show/hide)
Hey man I don't know what's wrong with your exact setup but what you're doing should work you have something wrong somewhere I've got paste and oil and everything I haven't made soap with it but I'm assuming I can make the soap as well if you want I'll make a soap industry real quick and do the soap too but I don't think I have to I've got the paste and I've got the press cake , it made the soap too 😁

I don't know what you did but you had to have done something something different fundamentally different between the almond tree and the apricot tree maybe there's a typo somewhere I don't know but I didn't copy your example exactly I just I just filled in the solid state names and the reaction stuff and it worked perfectly it looks goofy in the menus cuz it says apricot tree apricot oil

Good luck man your close 👍👍👍🔥🫠

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #4 on: April 18, 2024, 02:00:52 pm »

Thanks everyone for your help! I just discovered something—if I use dfhack to create PLANT_GROWTH ALMOND:NUT, that stacks differently than if I create SEEDS ALMOND?! and I can mill the former but not the latter?!

which explain my problem with apricots, since apricot seeds aren't PLANT_GROWTH, the way almonds have  GROWTH:NUT and avocados GROWTH:FRUIT... except rock nuts aren't GROWTH:NUT like tree nuts, and indeed, if I create rock nuts via "createitem SEEDS BUSH_QUARRY", I can't mill them, much like my apricots. I'm confused >.>
Logged

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #5 on: April 18, 2024, 03:05:35 pm »

Yup—confirmed I can press any seed that I can create via "createitem PLANT_GROWTH:NUT", and none created via "createitem SEEDS".  I'm tentatively chalking this to either some dfhack oddity, or something in how builtin objects are structured that prevents me from milling any non-PLANT_GROWTH seeds (except, for some reason, the plant_standard rock nut).



Guess I'll start a fortress in a tropical jungle and hope I come across a Prunus tree so I can check whether it's possible to mill the "natural" ones...

btw @aradar I think you can prevent it from showing like "apricot tree apricot oil" by putting [PREFIX:NONE]
Logged

aradar

  • Bay Watcher
  • Legendary bullshitter
    • View Profile
    • my steam workshop
Re: Producing oil from tree seeds: trouble with milling
« Reply #6 on: April 18, 2024, 04:37:55 pm »

Yup—confirmed I can press any seed that I can create via "createitem PLANT_GROWTH:NUT", and none created via "createitem SEEDS".  I'm tentatively chalking this to either some dfhack oddity, or something in how builtin objects are structured that prevents me from milling any non-PLANT_GROWTH seeds (except, for some reason, the plant_standard rock nut).



Guess I'll start a fortress in a tropical jungle and hope I come across a Prunus tree so I can check whether it's possible to mill the "natural" ones...

btw @aradar I think you can prevent it from showing like "apricot tree apricot oil" by putting [PREFIX:NONE]

It almost makes me want to think that it is DF hack related because when I did it I did everything with items that occurred naturally in the biome area that I embarked in if you're spawning things into existence with DF hack I don't I don't know enough about DF hack to know if it does anything differently to the objects when you make them

elilla

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

Just confirmed the same thing—I was able to produce cherry seed oil and soap from cherry trees that occur naturally, albeit it doesn't work with the "createitem SEED" command from dfhack.

There's something weird, though; the cherry pits are listed twice on the "seeds" section of a stockpile.  Maybe those "SELECT_PLANT" commands aren't working like I expected after all.  Later I'll try just copy-pasting the whole definition like most people do.
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #8 on: April 18, 2024, 09:59:44 pm »

I bet its because you used [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE] again even though it already existed in the file. If you instead used SELECT_MATERIAL:SEED] it should allow you to edit the seed material already created by the vanilla file. And you wouldnt need to include any of the info already implemented by the previous USE_MATERIAL_TEMPLATE. Just add your stuff.
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

elilla

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

@Eric thanks, that make sense! So I can just nest the SELECT tokens? Like

Code: [Select]
[SELECT_PLANT:APRICOT]
        [SELECT_MATERIAL:SEED]
                [MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
                etc
Logged

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #10 on: April 19, 2024, 11:36:58 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.
Logged

aradar

  • Bay Watcher
  • Legendary bullshitter
    • View Profile
    • my steam workshop
Re: Producing oil from tree seeds: trouble with milling
« Reply #11 on: April 20, 2024, 05:54:46 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.

To test this these types of mods you really don't need DF hack you can just add the plant part from prepared embark and embark with it.

elilla

  • Bay Watcher
    • View Profile
Re: Producing oil from tree seeds: trouble with milling
« Reply #12 on: April 21, 2024, 08:15:33 am »

Can you add tree seeds from the detailed embark?
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Producing oil from tree seeds: trouble with milling
« Reply #14 on: April 21, 2024, 04:44:14 pm »

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.
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.
Pages: [1] 2