Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Need beginner modding help.  (Read 772 times)

korpilakko

  • Escaped Lunatic
    • View Profile
Need beginner modding help.
« on: February 18, 2023, 12:02:15 am »

I'm trying to mod the game for the first time and I'm getting stuck pretty badly.
I'm trying to add chocolate bar making, first I did the steps as well as I could from following wiki and when it didn't work, I tried to compare my stuff to some "steam workshop coffee" mods because the process to make it is so similar, and even with that I can't get it to work.

Basically I'm trying to rename cacao beans to "roasted cacao beans" since you wouldn't see the raw ones anyway, make a reaction to harvest them from cacao pods, reaction to grind them to plant powder named "cacao nibs", and have "cacao nibs" + "dwarven sugar" grind result in "dwarven chocolate". I haven't been able to harvest 1 cacao bean so far.

All reactions are visible in game, but haven't seen them working so far.
2 of them say something like "Requires DC_GRIND_MAT-producing seeds" which looks ugly and I'd hope I can fix it somehow, and the final one says "Requires Dwarven sugar-containing item" which makes me think the other missing item "cacao nibs" is not working at all.

For now: I can't store cacao pods in fruits section even though I have "[STOCKPILE_PLANT_GROWTH]" under "[USE_MATERIAL_TEMPLATE:FRUIT:FRUIT_TEMPLATE]".
I can't store dwarven chocolate, which I'm trying to store in "Pressed foods" with presscakes.

Right now I can't even test the first step it but based on the first attempt in which cacao pod storing at least worked, the first reaction that used them, didn't register the pods usable in it, so I'd think it's still broken as well.

Any help would be appreciated!

Code: [Select]
plant_dwarvenchocolate

[OBJECT:PLANT]

[CUT_PLANT:CACAO]

[PLANT:CACAO]
[NAME:cacao tree][NAME_PLURAL:cacao trees][ADJ:cacao tree]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:cacao wood]
[STATE_ADJ:ALL_SOLID:cacao wood]
[PREFIX:NONE]
Based on Theobroma cacao
http://acta.inpa.gov.br/fasciculos/30-4/PDF/v30n4a06.pdf
[STATE_COLOR:ALL_SOLID:CHOCOLATE]  A delicious mix of irony and realism.
[SOLID_DENSITY:430]

[USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:cocoa butter]
[STATE_NAME_ADJ:LIQUID:melted cocoa butter]
[STATE_NAME_ADJ:GAS:boiling cocoa butter]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[EDIBLE_COOKED]
[USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:cocoa butter soap]
[STATE_NAME_ADJ:LIQUID:melted cocoa butter soap]
[STATE_NAME_ADJ:GAS:n/a]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:cacao nibs]
[STATE_COLOR:ALL_SOLID:CHOCOLATE]
[DISPLAY_COLOR:6:0:0]
[MATERIAL_VALUE:20]
[EDIBLE_VERMIN]
[EDIBLE_COOKED]
[PREFIX:NONE]
[MATERIAL_REACTION_PRODUCT:DC_CHOCOLATE_MAT:LOCAL_PLANT_MAT:DC_CHOCOLATE] this is used to make chocolate
[MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL] ..and cocoa butter (acts like an oil for now..)

[USE_MATERIAL_TEMPLATE:DC_CHOCOLATE:DC_CHOCOLATE_TEMPLATE] the only custom material
[STATE_NAME_ADJ:ALL_SOLID:dwarven chocolate]
[STATE_NAME_ADJ:LIQUID:melted dwarcen chocolate]
[STATE_NAME_ADJ:GAS:boiling dwarcen chocolate]
[STATE_COLOR:ALL:CHOCOLATE]
[MATERIAL_VALUE:50]
[DISPLAY_COLOR:6:0:0]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[STOCKPILE_GLOB_PRESSED]
[PREFIX:NONE]

[USE_MATERIAL_TEMPLATE:FRUIT:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:BROWN]
[DISPLAY_COLOR:6:0:0]
[EDIBLE_VERMIN]
[STOCKPILE_PLANT_GROWTH]
[MATERIAL_REACTION_PRODUCT:DC_PROCESS_MAT:LOCAL_PLANT_MAT:SEED] this is used to get and 'roast' beans

[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
[STATE_COLOR:ALL:WHITE]
[DISPLAY_COLOR:7:0:1]

[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[STATE_COLOR:ALL:BROWN]
[DISPLAY_COLOR:6:0:0]
[MATERIAL_VALUE:1]
[EDIBLE_COOKED]
[MATERIAL_REACTION_PRODUCT:DC_GRIND_MAT:LOCAL_PLANT_MAT:MILL] this is used to make cacao nibs

[SEED:roasted cacao bean:roasted cacao beans:6:0:0:LOCAL_PLANT_MAT:SEED]
[TREE:LOCAL_PLANT_MAT:WOOD][TREE_TILE:226]
[TRUNK_PERIOD:10]
[HEAVY_BRANCH_DENSITY:25]
[BRANCH_DENSITY:50]
[MAX_TRUNK_HEIGHT:2]
[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:flowers]
[DRY]
[BIOME:FOREST_TROPICAL_MOIST_BROADLEAF]
[FREQUENCY:100]
[SAPLING]
[GROWTH:LEAVES]
[GROWTH_NAME:cacao leaf:cacao leaves]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:BRANCHES_AND_TWIGS]
[GROWTH_HOST_TILE:SAPLING]
[GROWTH_PRINT:0:6:2:0:0:ALL:1]
[GROWTH:FLOWERS]
[GROWTH_NAME:cacao flower:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:HEAVY_BRANCHES_AND_TRUNK]
[GROWTH_TIMING:50000:99999]
[GROWTH_PRINT:5:5:7:0:1:50000:99999:2]
[GROWTH:FRUIT]
[GROWTH_NAME:cacao pod:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:STRUCTURAL]
[GROWTH_DENSITY:1000]
[GROWTH_HOST_TILE:HEAVY_BRANCHES_AND_TRUNK]
[GROWTH_TIMING:100000:200000]
[GROWTH_DROPS_OFF_NO_CLOUD]
[GROWTH_PRINT:'%':7:4:0:0:100000:200000:3]
[GROWTH_HAS_SEED]

Code: [Select]
reaction_dwarvenchocolate

[OBJECT:REACTION]

[REACTION:DC_PROCESS_PODS]
[NAME:process and roast cacao beans]
[BUILDING:KITCHEN:NONE]
[REAGENT:cacao pod:1:PLANT:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:DC_PROCESS_MAT]
[PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:plant:DC_PROCESS_MAT]
[SKILL:COOK]

[REACTION:DC_GRIND_CACAO_BEANS]
[NAME:grind roasted cacao beans]
[BUILDING:QUERN:NONE]
[BUILDING:MILLSTONE:NONE]
[REAGENT:cacao beans:1:SEEDS:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:DC_GRIND_MAT] DC_GRIND_MAT points to cacao nibs material
[REAGENT:bag:1:BAG:NONE:NONE:NONE]
[CONTAINS:beans]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:POWDER_MISC:NONE:GET_MATERIAL_FROM_REAGENT:beans:DC_GRIND_MAT]
[PRODUCT_DIMENSION:150]
[PRODUCT_TO_CONTAINER:bag]
[SKILL:MILLING]

[REACTION:DC_MAKE_CHOCOLATE]
[NAME:mix dwarven chocolate]
[BUILDING:QUERN:NONE]
[BUILDING:MILLSTONE:NONE]
[REAGENT:cacao nibs:150:POWDER_MISC:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:DC_CHOCOLATE_MAT] DC_CHOCOLATE_MAT points to the chocolate material
[REAGENT:bag:1:BAG:NONE:NONE:NONE]
[CONTAINS:grounds]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:dwarven sugar:150:POWDER_MISC:NONE:MILL:PLANT_POWDER_TEMPLATE]
[REAGENT:dwarven sugar container:1:NONE:NONE:NONE:NONE]
[CONTAINS:dwarven sugar]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:cacao nibs:DC_CHOCOLATE_MAT][PRODUCT_PRESSED]
[SKILL:COOK]

Code: [Select]
material_template_dwarvenchocolate

[OBJECT:MATERIAL_TEMPLATE]

[MATERIAL_TEMPLATE:CHOCOLATE_TEMPLATE]
[STATE_COLOR:ALL_SOLID:BROWN]
[STATE_NAME:ALL_SOLID:dwarven chocolate]
[STATE_ADJ:ALL_SOLID:dwarven chocolate]
[STATE_COLOR:LIQUID:BROWN]
[STATE_NAME:LIQUID:melted dwarven chocolate]
[STATE_ADJ:LIQUID:melted dwarven chocolate]
[STATE_COLOR:GAS:BROWN]
[STATE_NAME:GAS:n/a]
[STATE_ADJ:GAS:n/a]
[DISPLAY_COLOR:6:0:0]
[MATERIAL_VALUE:20]
[SPEC_HEAT:2400]
[IGNITE_POINT:10368]
[MELTING_POINT:10074]
[BOILING_POINT:NONE]
[HEATDAM_POINT:10153]
[COLDDAM_POINT:NONE]
[MAT_FIXED_TEMP:NONE]
[SOLID_DENSITY:960]
[LIQUID_DENSITY:NONE]
[MOLAR_MASS:NONE]
[IMPACT_YIELD:10000]
[IMPACT_FRACTURE:10000]
[IMPACT_STRAIN_AT_YIELD:100]
[COMPRESSIVE_YIELD:10000]
[COMPRESSIVE_FRACTURE:10000]
[COMPRESSIVE_STRAIN_AT_YIELD:100]
[TENSILE_YIELD:10000]
[TENSILE_FRACTURE:10000]
[TENSILE_STRAIN_AT_YIELD:100]
[TORSION_YIELD:10000]
[TORSION_FRACTURE:10000]
[TORSION_STRAIN_AT_YIELD:100]
[SHEAR_YIELD:10000]
[SHEAR_FRACTURE:10000]
[SHEAR_STRAIN_AT_YIELD:100]
[BENDING_YIELD:10000] no data
[BENDING_FRACTURE:10000]
[BENDING_STRAIN_AT_YIELD:100]
[MAX_EDGE:0]
[STOCKPILE_GLOB_PRESSED]
[DO_NOT_CLEAN_GLOB]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[EDIBLE_VERMIN]
[SYNDROME]
[SYN_NAME:eating chocolate]
[SYN_IDENTIFIER:CHOCOLATE]
[SYN_AFFECTED_CLASS:GENERAL_POISON
[SYN_INGESTED]
[SYN_NO_HOSPITAL]
[SYN_CONCENTRATION_ADDED:100:300]
[CE_FEEL_EMOTION:HAPPINESS:SEV:75:PROB:100:SIZE_DILUTES:START:10:PEAK:120:END:480:DWF_STRETCH:4]]
Logged

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: Need beginner modding help.
« Reply #1 on: February 18, 2023, 12:23:29 am »

You've got a wrong item type in the 'process and roast cacao beans' reaction.

You have the 'cacao pod' reagent require a PLANT item, but the pod in the tree raws is a PLANT_GROWTH item. So, changing the reagent item in the reaction to PLANT_GROWTH should work, except that:

Other thing I spotted is that GROWTH:FRUIT has LOCAL_PLANT_MAT:STRUCTURAL when you would be wanting it to be LOCAL_PLANT_MAT:FRUIT (since FRUIT has DC_PROCESS_MAT and STRUCTURAL does not).

So, the problems seem to be mainly related to the FRUIT growth having errors. Didn't spot other problems with a quick glance.

korpilakko

  • Escaped Lunatic
    • View Profile
Re: Need beginner modding help.
« Reply #2 on: February 18, 2023, 04:37:41 am »

That helped a lot, thanks!
Other problem I realized after putting that advice to test, was wrong names in reactions, reagent named "cacao beans" and in product referenced as "beans" etc.

I got things to work until the last reaction, I suspected it wasn't going to work as "dwarven chocolate" wasn't in the stockpile options, and the result was "cacao tree plant" named glob with tallow or liquid texture..
And sugar wasn't used in the reaction only the cacao nibs.
Logged

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: Need beginner modding help.
« Reply #3 on: February 18, 2023, 09:22:00 am »

No problem! There's not much info on plant modding on the Wiki, so I feel the pain of not getting things working and not figuring what's the problem. :)

The reason it's not using sugar looks to be that you have the following reagent:

[REAGENT:dwarven sugar:150:POWDER_MISC:NONE:MILL:PLANT_POWDER_TEMPLATE]

I'm assuming you're wanting to use sugar you get from sweet pods? So, it should look something like this:

[REAGENT:dwarven sugar:150:POWDER_MISC:NONE:PLANT_MAT:POD_SWEET:MILL]

Not entirely sure what's the issue with the glob, though.