Baron Sludge adds a small tech tree and optional processing steps around natural materials.
Natural materials can be "purified" into higher quality materials that produce more when processed. For example, stone can be "purified" into clay; smelted clay yields 150% more stone bricks than stone alone.
Purification also creates "sludge" which can processed back into water, and occassionally (10%) produces another material.
When Baron Sludge is used with Baron Factions, each faction gains exclusive access to one of the purification and sludge processing trees.
Resource Table
Resource | Cleaned Product | Sludge | Sludge Product | [Faction] |
---|---|---|---|---|
Stone | Clay | Stone Sludge | Crude Oil | Burner |
Coal | Coke | Coal Sludge | Uranium Ore | Burner |
Copper Ore | Cuprite | Copper Sludge | Iron Ore | Electric |
Iron Ore | Magnetite | Iron Sludge | Stone | Heat |
Uranium Ore | Yellowcake | Uranium Sludge | Copper Ore | Heat |
Crude Oil | Sweet Crude Oil | Oil Sludge | Coal | Steam |
Wood | Coke | Wood Sludge | Sawdust | Steam |
Modding
This mod adds baronSludge
as a global library.
How to create a new purification and sludge process.
For basic mods, only steps 1-4 are needed.
- Create a new "pure" item or fluid (OPTIONAL) -
baronSludge.createPureItem
finds and creates a modified copy of an existing item or fluid. The resulting item will be called "purified-[item]". The item or fluid may alternatively be created without calling baronSludge.
data:extend{
util.merge{baronSludge.createPureItem("stone"), {
icon = "__baron-sludge__/graphics/icons/purified-stone.png",
icon_size = 64,
order="s[sludge]-a",
}}
}
- Create a new "sluge" fluid (OPTIONAL) -
baronSludge.createSludge
creates a new sludge using the icon of an existing item or fluid. The resulting fluid will be called "[item]-sludge". The sludge may alternatively be created without calling baronSludge.
data:extend{
util.merge{
baronSludge.createSludge("stone"), {
order="s[sludge]-a"
}}
}
- Create purification recipe -
baronSludge.createPurification
creates a new purification recipe (categorypurifier
). By default, this recipe is also enabled for all modules and added to the "purifier" technology. If the new technology is used, it will also be gated on technologies for smelting the original material (this is to prevent advanced materials from becoming available too early.)
data:extend{
baronSludge.createPurification{
orig="stone", -- The name (or proto) of the input item/fluid
pure="purified-stone", -- The name (or proto) of the output item/fluid main_product
sludge="stone-sludge", -- The name (or proto) of the sludge fluid byproduct (can be "water")
amount=1, -- [OPTIONAL] the amount of input and output per cycle
hidden=false, -- [OPTIONAL] set to true to hide recipe (as if via settings)
new_technology=false, -- [OPTIONAL] also create a new gating technology for purification
}
}
- Create sludge processing recipe -
baronSludge.createSludgeProcessing
creates a new sludge processing recipe (categorypurifier
). By default, this recipe is also enabled for all modules and added to the "sludge" technology.
data:extend{
baronSludge.createSludgeProcessing{
sludge="stone-sludge", -- The name (or proto) of the sludge fluid to use
product="crude-oil", -- The name (or proto) of the sludge procesing result (can be same as original material)
probability=0.1, -- [OPTIONAL] The probabilty of creating the product amount
product_amount=1, -- [OPTIONAL] The amount of product created
hidden=false, -- [OPTIONAL] set to true to hide recipe (as if via settings)
new_technology=false, -- [OPTIONAL] also create a new technology for sludge processing
}
}
- Add purification configuration (OPTIONAL) -
baronSludge.addPureConfig
defines how recipes will be converted with the new "pure" materials. If omitted, this will be derived from thepurifier
recipes and defaults will be used.
baronSludge.addPureConfig{
orig = data.raw.item["coal"], -- The _proto_ of the raw item
pure = data.raw.item["purified-coal"], -- The _proto_ of the pure item
ingredient_multiplier = 2, -- Multiplier for the ingredients of recipe
result_multiplier = 3, -- Multiplier for the results of recipe
hidden=false, -- [OPTIONAL] set to true to hide recipe (as if via settings)
new_smelting_technology = true, -- [OPTIONAL] also create a new technology for each recipe affected by this config
},
- Manually add upgrade recipes (OPTIONAL) -
baronSludge.createUpgradedRecipe
will create the recipe for a pure resource, which will be named "[pure-name]-[recipe-name]". The recipe can then be freely modified. The recipe is also added to the same modules and appropriate technologies. If omitted, baronSludge will automatically call this for all appropriate recipes during thedata
anddata-final-fixes
stages.
data:extend{
baronSludge.createUpgradedRecipe("advanced-oil-processing")
}