16
DF Modding / Re: Powder state for metals
« on: March 11, 2011, 11:50:06 pm »[REACTION:CRUSH_METAL_ORE]
[NAME:crush metal ore]
[BUILDING:QUERN:CUSTOM_S]
[BUILDING:MILLSTONE:CUSTOM_S]
[REAGENT:metal ore:1:BOULDER:NONE:NONE:NONE][METAL_ORE] <-- havnt tested, but METAL_ORE does shows up in the string dump.
[REAGENT:bag 1:1:BOX:NONE:NONE:NONE][EMPTY][BAG][PRESERVE_REAGENT]
[REAGENT:bad 2:1:BOX:NONE:NONE:NONE][EMPTY][BAG][PRESERVE_REAGENT]
[PRODUCT:100:1:POWDER_MISC:NONE:GET_MATERIAL_FROM_REAGENT:metal ore:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:bag 1]
[PRODUCT:100:1:POWDER_MISC:NONE:GET_MATERIAL_FROM_REAGENT:metal ore:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:bag 2]
[SKILL:MILLER]
Should be something like this. Not sure what you mean by 'non metal powder', you can make any item out of any material you like. It might be that you modified the metal template, not realising metal ores use the stone template.
Smelting the stuff is where i gets more convoluted. You would have to either make new smelting reaction reaction for each ore, or use product reagent tags to refer ores to their metals. The first is probabaly preferable, while it will clutters your furnace it does let you smelt specific metals.
The later would still mean you have to modify every single metal ore by hand, and also that you have to work in some weird system to handle multiple metal ores. You could simply add more than one product reagent tag to all ores, and the same number of products with a limited chance to be produced. This would also cause problem with reactions sometimes producing nothing or multiple bars of metal.
I tried [METAL_ORE] like that, but it ended up not using any ore at all, and just putting two non-metal powders (by the way, what I mean by that is that it just produces two plain "powders" that aren't actually made of anything) in the bags. And doing the PRODUCTs that way takes the material from the ore itself, not the metal it's made of (so if you were to crush a piece of hematite, you'd get two units of hematite powder, not two units of iron powder. But since I didn't give each individual mineral a powder form, it just shows up as hematite.
Anyways, the way I'm doing it is adding a separate reaction for each ore, and for ores that could smelt into multiple things, the chances of each product is the same as the chances of smelting into the metal (e.g. pulverizing tetrahedrite would have a 100% chance of producing two piles of copper dust, and a 20% chance of also producing two piles of silver dust, just as smelting tetrahedrite ore always smelts into copper, but also smelts into silver 1/5 of the time).
Now that I think about it...for ores that can produce multiple metals, perhaps I should require additional bags just in case...