Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Wood Industry Modding [SOLVED]  (Read 2451 times)

Abregado

  • Bay Watcher
    • View Profile
Wood Industry Modding [SOLVED]
« on: February 27, 2012, 07:40:29 pm »

I havent seen anyone do this in a mod yet. Most advanced thing would be turning one log into many blocks.

Looking to have several varieties of timber available from each tree. It seems that removing the [ITEMS_HARD], [ITEMS_WEAPON], [WOOD] tokens from the wood_template does nothing. If it comes from a tree you can use it for any wood related activity.

Would ideally want the basic logs to be useless until processed. Dressed logs could be used for [ITEMS_HARD] and polished logs for everything else...

Anyone played around with this?

Code: [Select]
[PLANT:DEADWOOD]
[NAME:deadwood][NAME_PLURAL:deadwoods][ADJ:deadwood]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[USE_MATERIAL_TEMPLATE:RAW_WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:raw deadwood]
[STATE_ADJ:ALL_SOLID:raw deadwood]
[PREFIX:NONE]
[MATERIAL_VALUE:1]
[USE_MATERIAL_TEMPLATE:DRESSED_WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:dressed deadwood]
[STATE_ADJ:ALL_SOLID:dressed deadwood]
[PREFIX:NONE]
[MATERIAL_VALUE:3]
[USE_MATERIAL_TEMPLATE:POLISHED_WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:polished deadwood]
[STATE_ADJ:ALL_SOLID:polished deadwood]
[PREFIX:NONE]
[MATERIAL_VALUE:9]
[TREE:LOCAL_PLANT_MAT:RAW_WOOD][TREE_TILE:255][TREE_COLOR:6:10:0]
[DEAD_TREE_TILE:255][DEAD_TREE_COLOR:7:8:0]
[PREFSTRING:hard timber]
[WET]
[BIOME:ANY_LAND]
[SAPLING]
« Last Edit: February 27, 2012, 08:39:01 pm by Abregado »
Logged

krisslanza

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding
« Reply #1 on: February 27, 2012, 07:49:41 pm »

There is a sawmill mod around, that basically turns a log into a number of generic blocks that have a wooden color.

Although, I have thought of taking the idea and expanding it, so you could maybe cut the logs into lumber, or something, and still make furniture out of it. It just kind of bugs me that it takes an ENTIRE tree to make a single, lousy bed? However, I'm not sure if this would work or not - or at least, not without making custom reactions or something.

Courtesy Arloban

  • Bay Watcher
  • This isn't a fortress... ...It's also not a map.
    • View Profile
Re: Wood Industry Modding
« Reply #2 on: February 27, 2012, 08:02:52 pm »

Even if you were to change your RAW_WOOD to use something other than the WOOD_TEMPLATE the hardcoded workshop will still use it, the only way to stop it would be to make a custom Woodshop, and prevent your Civ from using the hardcoded wood workshop. 

I've thought about doing this for the purpose of adding fruit and leaves to trees and turning the logs into fruit, leaves, and special made tools, called Timbers, that can be used, or converted into Blocks.
Logged
Maybe that the dwarves never died and everyone is just shunning them.
"Wait, what are you doing?  I don't want to go in there!  No, I'm still alive, you can't do this to me!  Is Anybody listening?  Hello... Can someone let me out?  Help me!  Is anyone there?  I'm running out of air!"

Abregado

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding
« Reply #3 on: February 27, 2012, 08:31:06 pm »

Victory. I made it work. Woodworking is now more labour intensive, and much more descriptive.

Using MATERIAL_REACTION_PRODUCTS and trees that done grow in the wild I came up with this. Only need to add 2 new trees, 2 automated reactions and then one line to each existing tree in DF to get it working.

New Trees (to allow proper stockpiling, as the listed options under Wood Stockpile are generated from the [TREE:LOCAL_PLANT_MAT:YADAYADA] token -_-

Code: [Select]
[PLANT:TIMBER]
[NAME:timber][NAME_PLURAL:timber][ADJ:timber]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[USE_MATERIAL_TEMPLATE:SAWN_WOOD:WOOD_TEMPLATE]
[MATERIAL_REACTION_PRODUCT:WOOD_PREP_DRESS:PLANT_MAT:DRESSED_TIMBER:DRESSED_WOOD]
[STATE_NAME:ALL_SOLID:timber]
[STATE_ADJ:ALL_SOLID:timber]
[PREFIX:NONE]
[MATERIAL_VALUE:2]
[TREE:LOCAL_PLANT_MAT:SAWN_WOOD]

[PLANT:DRESSED_TIMBER]
[NAME:dressed timber][NAME_PLURAL:dressed timber][ADJ:fine wooden]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[USE_MATERIAL_TEMPLATE:DRESSED_WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:dressed timber]
[STATE_ADJ:ALL_SOLID:fine wooden]
[PREFIX:NONE]
[MATERIAL_VALUE:3]
[TREE:LOCAL_PLANT_MAT:DRESSED_WOOD]

Additions to current trees to allow these reactions. Overwrite the existing part
Code: [Select]
[USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
[MATERIAL_REACTION_PRODUCT:WOOD_PREP_SAW:PLANT_MAT:TIMBER:SAWN_WOOD]
[STATE_NAME:ALL_SOLID:raw deadwood]
[STATE_ADJ:ALL_SOLID:whittled wood]
[PREFIX:NONE]
[MATERIAL_VALUE:1]

And the two reactions. currently performed at the kiln until I make a custom workshop. Probably add a special tool to each to facilitating "teching up"...

Code: [Select]
REACTION:SAW_WOOD]
[NAME:Saw logs into timber]
[BUILDING:KILN:NONE]
[REAGENT:logs:2:WOOD:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:WOOD_PREP_SAW]
[PRODUCT:100:2:WOOD:NONE:GET_MATERIAL_FROM_REAGENT:logs:WOOD_PREP_SAW]
[PRODUCT:50:1:WOOD:NONE:GET_MATERIAL_FROM_REAGENT:logs:WOOD_PREP_SAW]
[PRODUCT:25:1:WOOD:NONE:GET_MATERIAL_FROM_REAGENT:logs:WOOD_PREP_SAW]
[SKILL:WOODCUTTING]
[AUTOMATIC]

[REACTION:DRESS_TIMBER]
[NAME:Dress sawn timber]
[BUILDING:KILN:NONE]
[REAGENT:timber:1:WOOD:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:WOOD_PREP_DRESS]
[PRODUCT:100:1:WOOD:NONE:GET_MATERIAL_FROM_REAGENT:timber:WOOD_PREP_DRESS]
[SKILL:CARPENTRY]
[AUTOMATIC]

You can also tell if your carpenters made something out of a whole log because it will be described as a "whittled wood barrel/bucket", while the other timbers also have new descriptors. Just remember to set the stockpile near the carpenter/craft workshop to only accept dressed timber.

Interus

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding
« Reply #4 on: February 27, 2012, 08:48:06 pm »

There is a sawmill mod around, that basically turns a log into a number of generic blocks that have a wooden color.

Although, I have thought of taking the idea and expanding it, so you could maybe cut the logs into lumber, or something, and still make furniture out of it. It just kind of bugs me that it takes an ENTIRE tree to make a single, lousy bed? However, I'm not sure if this would work or not - or at least, not without making custom reactions or something.

Too make furniture, it would have to be a log, and the main problem people have with that is that using logs to make more logs is extremely problematic.  However, I think you could solve the problem by duplicating the wood template, adding a reaction class to one of them, and then adding a second type of wood to every tree that doesn't have the reaction class.  If you do that, I'm pretty sure you could create a reaction that takes a log of wood with the reaction class and creates, say, 3 logs of the processed variation of that tree.

I'm not 100% sure this would work.  I did something similar when experimenting with paint, and while I never got an error report from the reaction during worldgen, I also never made it the testing phase.  Mostly because I couldn't get my dwarves to actually create the paint itself.



Edit:  Derp, looks like that's what you did huh?  But you don't need to make custom trees, I think.  You could mess with the template files, or just straight add it to each tree, since you would still have to add something to each one either way.  Or maybe I can just shut up and actually read everything.
« Last Edit: February 27, 2012, 08:53:51 pm by Interus »
Logged

krisslanza

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding
« Reply #5 on: February 27, 2012, 09:01:30 pm »

There is a sawmill mod around, that basically turns a log into a number of generic blocks that have a wooden color.

Although, I have thought of taking the idea and expanding it, so you could maybe cut the logs into lumber, or something, and still make furniture out of it. It just kind of bugs me that it takes an ENTIRE tree to make a single, lousy bed? However, I'm not sure if this would work or not - or at least, not without making custom reactions or something.

Too make furniture, it would have to be a log, and the main problem people have with that is that using logs to make more logs is extremely problematic.  However, I think you could solve the problem by duplicating the wood template, adding a reaction class to one of them, and then adding a second type of wood to every tree that doesn't have the reaction class.  If you do that, I'm pretty sure you could create a reaction that takes a log of wood with the reaction class and creates, say, 3 logs of the processed variation of that tree.

I'm not 100% sure this would work.  I did something similar when experimenting with paint, and while I never got an error report from the reaction during worldgen, I also never made it the testing phase.  Mostly because I couldn't get my dwarves to actually create the paint itself.



Edit:  Derp, looks like that's what you did huh?  But you don't need to make custom trees, I think.  You could mess with the template files, or just straight add it to each tree, since you would still have to add something to each one either way.  Or maybe I can just shut up and actually read everything.

Yeah thats the problem I encountered whilst thinking about it. I know people have used mods to make beds out of stone, so I assume you could make a "custom" tree-type that is then used to make furniture via a custom reaction. Or just go under the usual idea of borderline "cheating", in that its a single player game anyway, and really what one defines as cheating is up to them.

Still, Abregado has done some interesting work... I'll have to give it a whirl sometime.

Interus

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding
« Reply #6 on: February 27, 2012, 09:30:51 pm »

Spoiler (click to show/hide)

Well the idea is to have two kinds of wood.  You can't really keep the one kind from being used to produce furniture, and actually, I think making a separate tree for the logs that all trees are processed into is a nice way to prevent clutter, allow production of extra logs, and prevent production of infinite logs.  When  I think about it, my way was far messier.  While it would allow wood to maintain its type, I think it would probably make it very difficult to tell which is which.
Logged

Abregado

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding [SOLVED]
« Reply #7 on: February 27, 2012, 09:43:57 pm »

it is possible to put all the materials in the one tree, but then they are not shown as separate materials on the stockpiling screen. At least this way you only need to add 2 tree, and 3 line changes to each tree, rather than doubling the lines of every tree variety.

Playing with this more now, attempting to create some interesting gameplay once you add Oils, laminates and metal tools to the mix. Apparently Glass Hardening is another method of strengthening wood. Might try to tie the wood industry into other industries. For now the only two incentives I can add for these reactions are:

Utility: Different types of wood have different reaction classes [REACTION_CLASS:WOOD_ARMOR] and [REACTION_CLASS:WOOD_WEAPON] come to mind
Quantity: Changing to the new type yields more units to work with
Value: higher wood types have more value
Strength: Different wood logs have better combat values.

Problem comes to give them to your elves you must make a tree that can grow this wood type. Guess I can just put them in the [GOOD] biome huh?

Anybody know if you can stop Wooden tools being available at embark? the [HARD_MAT] and [METAL_WEAPON_MAT] don't seem to effect embark availability.

Interus

  • Bay Watcher
    • View Profile
Re: Wood Industry Modding [SOLVED]
« Reply #8 on: February 27, 2012, 09:55:27 pm »

Doesn't Genesis have elves with special wooden equipment?  I can't remember how that works though, and I suspect it may just be making it available in that biome.

No idea on the tools, sorry.
Logged