Hey guys, credits to original posts are at the bottom of the post, but I thought people might be interested in ready to use code:
Ever wanted to burn all those non-masterpiece beds? Ever thought: I need more charcoal, but all these elves sell are useless wooden goods? worry no more!
The code below lets you burn furniture and other wooden objects at a wood furnace to obtain charcoal. Normally, a new ID is used for a new reaction. The downside of a new reaction is that a map regen is necessary. The example below shows how a reaction ID of a current game (making billon from raw ores) can be used to add a new reaction without having to start over a map.
In the code, for each piece of wood furniture, 0.25 charcoal is generated. This is just for balance, 1 on 1 recycle seems cheaty. Since custom reactions can't work in the same way as melting metal, 1 bar of charcoal is generated for 4 units of furniture. Since 4 different reagents are used, this does not necessarily need to be 4 beds, but can be 4 different wood objects. in the current code, each type of wooden object is elligible, so it is advisable to create an additional wood furnace and link specific stockpiles to this furnace. This allows you to burn low quality items, while preventing your masterpiece beds going up in flames.
the text below replaces the original 'billon making' reaction in data/save/'your save'/raw/objects/reaction_smelter.txt.
[REACTION:BILLON_MAKING]
[NAME:burn furniture]
[BUILDING:WOOD:CUSTOM_B]
[REAGENT:A:1:NONE:NONE:NONE:NONE][ANY_PLANT_MATERIAL][HARD_ITEM_MATERIAL][EMPTY]
[REAGENT:B:1:NONE:NONE:NONE:NONE][ANY_PLANT_MATERIAL][HARD_ITEM_MATERIAL][EMPTY]
[REAGENT:C:1:NONE:NONE:NONE:NONE][ANY_PLANT_MATERIAL][HARD_ITEM_MATERIAL][EMPTY]
[REAGENT:D:1:NONE:NONE:NONE:NONE][ANY_PLANT_MATERIAL][HARD_ITEM_MATERIAL][EMPTY]
[PRODUCT:100:1:BAR:NO_SUBTYPE:COAL:CHARCOAL][PRODUCT_DIMENSION:150]
[SKILL:WOOD_BURNING]
An important thing to note is that the code above works with all wood items. You don't want to turn every single wooden bolt into 0.25 charcoal. So keep that in mind while setting up the stockpiles.
Also, for wooden crafts 3 pieces are created for every piece of wood. So, if you have wooden crafts, you may want to add an additional reaction which uses 12 reagents instead of 4.
The original information comes from the following 2 posts:
turn wood items into charcoal
http://www.bay12forums.com/smf/index.php?topic=64706.0[Reaction] Burn wooden object to ash
http://www.bay12forums.com/smf/index.php?topic=151874.msg6377142#msg6377142especially the last one was useful. But somehow it did not turn up in my search queries, I only found it after 2 hours of experimentation based on the first post and only then using some reaction details in the search quer. Apparently, 'wood' and 'wooden' aren't interchangeable. That's why I've added the extra tags in the title. If I need to add other tags for future reference, please let me know! (although, is it possible to change the title on existing posts?)
Also, I just found there is an example custom reaction page on the wiki!
http://dwarffortresswiki.org/index.php/DF2014:Reaction_examplesI've added the code above to it. I've also added a link to it from the main 'custom reaction' page, but I would encourage others to add their useful reactions to this page!