Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Lumber Mills - Is It Possible?  (Read 1289 times)

Toxicles

  • Bay Watcher
  • Kiss me I'm hazardous.
    • View Profile
Lumber Mills - Is It Possible?
« on: August 20, 2010, 11:28:13 pm »

One thing I've been trying to mod in is the Lumber Mill.  Basic idea is that, when you cut down a tree, you get timber, which must be taken to the mill for processing.  This lets trees go further (I always seem to be running out of wood) and lets the dwarves do things like make syrup and use leaves for fertilizer.  However, I can't seem to get it to work.

Here's the basics of what I have now:

[MATERIAL_REACTION_PRODUCT:WOOD_MAT:LOCAL_PLANT_MAT:WOOD]
[MATERIAL_REACTION_PRODUCT:LEAF_MAT:LOCAL_PLANT_MAT:LEAF]
[MATERIAL_REACTION_PRODUCT:SYRUP_MAT:LOCAL_PLANT_MAT:SYRUP]

First, I copied the WOOD_TEMPLATE to create the TIMBER_TEMPLATE.  The latter had the [WOOD] tag removed, as it seems the intent was that you can use whatever has that tag as a log.  Trees, rather than producing a WOOD log, would produce a TIMBER log, which needed to be processed.  The mill would you give you three WOOD boards, a stack of leaves, and a stack of extract.

Here's an example of what got stuffed in the tree file:

Code: [Select]
[USE_MATERIAL_TEMPLATE:TIMBER:TIMBER_TEMPLATE]
[STATE_NAME:ALL_SOLID:bleeding hand timber]
[STATE_ADJ:ALL_SOLID:bleeding hand timber]
[PREFIX:NONE]
[STATE_COLOR:ALL_SOLID:MAROON]
[DISPLAY_COLOR:4:0:0]
[USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:bleeding hand]
[STATE_ADJ:ALL_SOLID:bleeding hand]
[PREFIX:NONE]
[STATE_COLOR:ALL_SOLID:MAROON]
[DISPLAY_COLOR:4:0:0]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_NAME:ALL_SOLID:bleeding hand leaves]
[STATE_ADJ:ALL_SOLID:bleeding hand leaf]
[PREFIX:NONE]
[STATE_COLOR:ALL_SOLID:SCARLET]
[DISPLAY_COLOR:4:0:1]
[EDIBLE_COOKED]
[ROTS]
[USE_MATERIAL_TEMPLATE:SYRUP:PLANT_EXTRACT_TEMPLATE]
[STATE_NAME:ALL_SOLID:clot syrup]
[STATE_ADJ:ALL_SOLID:clot syrup]
[PREFIX:NONE]
[STATE_COLOR:ALL_SOLID:MAROON]
[DISPLAY_COLOR:4:0:0]
[BOILING_POINT:12000]
[MELTING_POINT:11500]
[EDIBLE_COOKED]

While I figure out how to get the syrup to be a liquid in a barrel, but not with a log in the barrel, I just made the syrup stay solid at "regular" temperatures.  This way, it can be hauled like globs.

Code: [Select]
[REACTION:PROCESS_TIMBER]
[NAME:process timber]
[BUILDING:LUMBER_MILL:CUSTOM_T]
[REAGENT:TIMBER:1:LOG:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:WOOD_MAT]
[PRODUCT:100:3:BAR:NONE:GET_MATERIAL_FROM_REAGENT:TIMBER:WOOD_MAT]
[PRODUCT:100:1:LEAF:NONE:GET_MATERIAL_FROM_REAGENT:TIMBER:LEAF_MAT]
[PRODUCT:100:1:EXTRACT:NONE:GET_MATERIAL_FROM_REAGENT:TIMBER:SYRUP_MAT]
[AUTOMATIC]
[SKILL:CARPENTER]

Now here's where I'm running into problems.

Having the reaction make a log crashes the game.  The leaves come out with no names, but they exist.  Syrup...I have no idea.

I can sort of get it to make bars, but they don't work quite right.  Aside from that, removing the [WOOD] tag from the TIMBER_TEMPLATE entry doesn't prevent dwarves from using the unprocessed timber as a building material, nor does it stop them from building stuff in a carpenter's shop out of them.  Apparently, they ignore the [WOOD] tag and just grab the nearest log, while cutting down a tree automatically produces a log no matter what you put in the raws.
Logged
Erush Kolokol cancels eat: on fire.

existent

  • Bay Watcher
  • I Watch Bays
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #1 on: August 21, 2010, 12:17:39 am »

This mod exists. Lemme find it.

Edit: http://www.bay12forums.com/smf/index.php?topic=56842
Logged
[DF 0.31.13]  ۝ War of the Ring Mod ۝  [WotR 0.13.3]

War of the Ring is back baby!
A mod based on Lord of the Rings, by JRR Tolkien.

Toxicles

  • Bay Watcher
  • Kiss me I'm hazardous.
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #2 on: August 21, 2010, 12:33:47 am »

Similar to what I was trying, but I'd like to prevent dwarves from using the raw logs for...well, anything and then not have "bleeding hand wood block bed."
Logged
Erush Kolokol cancels eat: on fire.

dree12

  • Bay Watcher
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #3 on: August 21, 2010, 02:42:18 pm »

Remove:
[ITEMS_HARD]
[ITEMS_WEAPON]
[ITEMS_WEAPON_RANGED]
[ITEMS_AMMO]
[ITEMS_ARMOR]
[ITEMS_SIEGE_ENGINE]
from each log you don't want dwarves to use.
Logged

Toxicles

  • Bay Watcher
  • Kiss me I'm hazardous.
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #4 on: August 21, 2010, 04:11:02 pm »

What I'm seeing is that carpenters are hard-coded to grab logs to make pretty much everything.  Wood bars don't behave properly.  You can build buildings out of wood blocks, and can turn a lot into many of them, but it isn't what I'm going for.
Logged
Erush Kolokol cancels eat: on fire.

dree12

  • Bay Watcher
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #5 on: August 21, 2010, 06:58:26 pm »

Remove:
[ITEMS_HARD]
[ITEMS_WEAPON]
[ITEMS_WEAPON_RANGED]
[ITEMS_AMMO]
[ITEMS_ARMOR]
[ITEMS_SIEGE_ENGINE]
from each log you don't want dwarves to use.
Ahem.
Logged

Toxicles

  • Bay Watcher
  • Kiss me I'm hazardous.
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #6 on: August 22, 2010, 12:16:00 am »

I did that, but dwarves still keep grabbing logs to make things in the carpenter's shop.

I created a separate material template for the timber without those tags, and without the [WOOD] tag, and it didn't help.

What I did was have trees, when cut down, point to the TIMBER_TEMPLATE for the log, but be processed to the WOOD_TEMPLATE that had those tags.  It didn't work.
Logged
Erush Kolokol cancels eat: on fire.

JediaKyrol

  • Bay Watcher
  • I have no idea what I am doing...
    • View Profile
Re: Lumber Mills - Is It Possible?
« Reply #7 on: August 25, 2010, 08:33:04 am »

I'm guessing you replaced [TREE:LOCAL_PLANT_MAT:WOOD] with [TREE:LOCAL_PLANT_MAT:TIMBER] in each tree.  but the big problem seems to be the "GET_MATERIAL_FROM_REAGENT:TIMBER:WOOD_MAT]" part...as calling a material tag, and then calling another material tag seems to cause a crash...the easiest...yet most tedious way to fix this would to be to create an inorganic group containing each of the new wood leaf and sap sets and then make an automatic reaction for every tree type...
Logged