Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Metal Plants  (Read 813 times)

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Metal Plants
« on: August 20, 2018, 08:27:11 pm »

Would it be possible to mod in a plant that metal bars could be harvested from?

By this, I mean can a plant be made where the "Process plant" reaction gives metal bars, or else something that could be smelted into metal? Alternatively, could a plant be made structurally from metal, so you could smelt the plant directly?

The first of these is preferable, as the reaction would hopefully some metal and some seeds.

If this is possible, how would I go about making it happen? I'm not a complete stranger to DF modding, as I've made some reactions, interactions, and items before, but plant and creature modding are things that I've never tried before.
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Metal Plants
« Reply #1 on: August 20, 2018, 08:51:29 pm »

can just have it make GROWTHs that are metal bars or ore, ore would be cool

But yeah it's fairly easy to make custom reactions to do just what you asked
Logged

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Metal Plants
« Reply #2 on: August 20, 2018, 09:30:25 pm »

I'm trying to avoid custom reactions in favor of just being able to use the ones native to the farmer's workshop.
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Metal Plants
« Reply #3 on: August 20, 2018, 09:37:33 pm »

then best bet is GROWTHs
Logged

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Metal Plants
« Reply #4 on: August 20, 2018, 09:41:38 pm »

Could you give me some direction as to how to go about making this?
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Metal Plants
« Reply #5 on: August 20, 2018, 09:43:33 pm »

Code: [Select]
[PLANT:CUCUMBER] cucumis sativus, vine
[NAME:cucumber vine][NAME_PLURAL:cucumber vines][ADJ:cucumber vine]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[PICKED_TILE:58][PICKED_COLOR:2:0:0]
[DRY][BIOME:FOREST_TROPICAL_DRY_BROADLEAF][BIOME:GRASSLAND_TROPICAL][BIOME:SAVANNA_TROPICAL][BIOME:SHRUBLAND_TROPICAL]
[VALUE:2]
[SPRING][SUMMER][AUTUMN][WINTER]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
[STATE_COLOR:ALL:YELLOW]
[DISPLAY_COLOR:6:0:1]
[USE_MATERIAL_TEMPLATE:FRUIT:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[STOCKPILE_PLANT_GROWTH]
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[SEED:cucumber seed:cucumber seeds:7:0:1:LOCAL_PLANT_MAT:SEED]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[PREFSTRING:fruit]
[GROWTH:LEAVES]
[GROWTH_NAME:cucumber leaf:cucumber leaves]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
[GROWTH_DENSITY:1000]
[GROWTH_PRINT:0:6:2:0:0:ALL:1]
[GROWTH:FLOWERS]
[GROWTH_NAME:cucumber flower:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:60000:119999]
[GROWTH_PRINT:5:5:6:0:1:60000:119999:2]
[GROWTH:FRUIT]
[GROWTH_NAME:cucumber:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FRUIT]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:120000:200000]
[GROWTH_DROPS_OFF]
[GROWTH_PRINT:'%':'%':2:0:0:120000:200000:3]
[GROWTH_HAS_SEED]

From vanilla
Logged

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Metal Plants
« Reply #6 on: August 20, 2018, 11:59:52 pm »

Alright, I think I'm almost there, but for some reason the reaction I made isn't appearing in workshops. Can anyone spot the problem?

Here's the material in the plant:
Code: [Select]
[USE_MATERIAL_TEMPLATE:BAR:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:GRAY]
[DISPLAY_COLOR:2:0:0]
[ITEM_REACTION_PRODUCT:BAR_PLANT:BAR:NO_SUBTYPE:METAL:STEEL]
[MATERIAL_VALUE:6]
[SOLID_DENSITY:10]
[STOCKPILE_PLANT_GROWTH]

And here is the reaction:
Code: [Select]
[REACTION:PROCESS_BARS_FROM_PLANT]
[NAME:process metal from plant]
[BUILDING:CRAFTSMAN:NONE]
[REAGENT:plant:1:PLANT:NONE:NONE:NONE]
[HAS_ITEM_REACTION_PRODUCT:BAR_PLANT]
[UNROTTEN]
[PRODUCT:150:1:GET_ITEM_DATA_FROM_REAGENT:plant:BAR_PLANT]
[SKILL:PROCESSPLANTS]
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Metal Plants
« Reply #7 on: August 21, 2018, 12:52:54 am »

Hey, after some more tinkering, I figured out that there was nothing wrong with my reactions, I just forgot to enable them. Here are the completed raws:

The plant:
Code: [Select]
[PLANT:STEELWORT] can be any metal you want, really
[NAME:steelwort][NAME_PLURAL:steelwort][ADJ:steelwort]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[PICKED_TILE:58][PICKED_COLOR:2:0:0]
[DRY][BIOME:NOT_FREEZING]
[VALUE:5]
[GROWDUR:300]
[SPRING][SUMMER][AUTUMN][WINTER]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
[STATE_COLOR:ALL:YELLOW]
[DISPLAY_COLOR:6:0:1]
[USE_MATERIAL_TEMPLATE:FRUIT:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[MATERIAL_VALUE:5]
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[STOCKPILE_PLANT_GROWTH]
[USE_MATERIAL_TEMPLATE:BAR:FRUIT_TEMPLATE]
[STATE_COLOR:ALL:GRAY]
[DISPLAY_COLOR:0:0:1]
[ITEM_REACTION_PRODUCT:BAR_PLANT:BAR:NONE:METAL:STEEL]
[MATERIAL_VALUE:6]
[SOLID_DENSITY:10]
[STOCKPILE_PLANT_GROWTH]
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[SEED:steelwort seed:steelwort seeds:7:0:1:LOCAL_PLANT_MAT:SEED]
[FREQUENCY:0]
[CLUSTERSIZE:5]
[PREFSTRING:utility]
[GROWTH:LEAVES]
[GROWTH_NAME:steelwort leaf:steelwort leaves]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
[GROWTH_DENSITY:1000]
[GROWTH_PRINT:0:6:2:0:0:ALL:1]
[GROWTH:FLOWERS]
[GROWTH_NAME:steelwort flower:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:60000:119999]
[GROWTH_PRINT:5:5:6:0:1:60000:119999:2]
[GROWTH:FRUIT]
[GROWTH_NAME:steelcumber:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FRUIT]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:120000:200000]
[GROWTH_DROPS_OFF]
[GROWTH_PRINT:'%':'%':2:0:0:120000:200000:3]
[GROWTH_HAS_SEED]
[GROWTH:BAR]
[GROWTH_NAME:steelpod:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:BAR]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:120000:200000]
[GROWTH_DROPS_OFF]
[GROWTH_PRINT:'o':'o':2:0:0:120000:200000:3]

The reaction:
Code: [Select]
[REACTION:PLANT_METAL]
[NAME:process metal from plant]
[BUILDING:FARMER:NONE]
[REAGENT:plant:1:PLANT_GROWTH:NONE:NONE:NONE]
[HAS_ITEM_REACTION_PRODUCT:BAR_PLANT]
[UNROTTEN]
[PRODUCT:100:1:GET_ITEM_DATA_FROM_REAGENT:plant:BAR_PLANT]
[SKILL:PROCESSPLANTS]

The metal pods are treated as fruit for storage purposes.
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

Xyon

  • Bay Watcher
    • View Profile
Re: Metal Plants
« Reply #8 on: September 06, 2018, 01:33:50 pm »

I saw a news article and thought I should post it in this thread, as it kinda seems related.   https://www.bbc.com/news/science-environment-45398434

Real plants that do soak up metals from the ground.
Logged