Scrappy Industry


Repurpose the waste from the imprecise assembly of machines for new materials. No process is ever truly perfect.

Content
6 days ago
2.0
815
Mining Manufacturing
Owner:
SafTheLamb
Source:
https://github.com/SafTheLamb/fm-scra...
Homepage:
https://discord.gg/S8YzkWcy4k
License:
MIT
Created:
a month ago
Latest Version:
0.8.0 (6 days ago)
Factorio version:
2.0
Downloaded by:
815 users

Scrappy Industry

The engineer meticulously tightens the last screw on their brand new transport belt... and turns it a few times too many. The mechanism is entirely ruined... but not unsalvageable. Swearing yet undeterred, they throw its sproingy remains onto the pile of rejects and begin anew.

Mechanics:

  • Not for the faint of heart, this mod gives many recipes a (very low) percent chance to fail, and an approximately corresponding percent chance to yield scrap materials.
  • This does not yield Fulgoran scrap, but instead random bits and pieces of iron, copper, circuitry, etc.
  • Metal scrap can be smelted back into plates for re-use, and circuit scrap can be crafted back into electronic and advanced circuits. No recycler needed!
  • New in 0.2.0: Plastic bars and LDS now yield Plastic bits as byproducts, which can be crafted back into Plastic bars with a bit of petroleum gas. (Optional)
  • New in 0.3.0: Lithium dust is the byproduct from Lithium, which is volatile and must be dealt with quickly. (Optional)
  • Fully compatible with Space Age, and plays well with all of the mods I've tested so far.

NOTE: This does NOT work well with adding to an existing game. You theoretically could but I don't advise it since all of your machines would fill up with unhandled scrap.

Compatibility:

  • Generally, this mod should be compatible with any other mod, though new metals and resources won't have scrap items unless supported.
  • Space Age: Tungsten scrap, Holmium scrap, and Lithium dust
  • AAI Industry: Sand
  • Wooden Industry: Woodchips
  • Lead: Lead scrap
  • Titanium: Titanium scrap
  • Tin: Solder added to recipes for circuits from scrap
  • Rusting Iron: Rusty iron scrap
  • Bluetonium: Radioactive waste
  • Voidcraft: Scrap included in random voidcrafting outcomes

Modding Interface:

  • This mod has an API for adding new items and recipe byproducts.
  • ScrapIndustry.items[] is the main access point, defining what the byproduct item(s) are (scrap=), how much each amount contributes to the scrap amount (scale=), and how much to penalize the success of the recipe for being more complex (failrate=)
  • New in 0.2.0: You can now add multiple scrap byproducts from the same item, e.g. scrap={"iron-scrap", "steel-scrap"}.
  • ScrapIndustry.recipes[] can be used for customizing specific recipes where the default values aren't what you intended. You can set ignore=true to bypass the recipe entirely. failrate=n overrides the auto-calculated value. self_scrap=true changes the recipe to index its products instead of its ingredients for calculating scrap (e.g. used for circuit recipes in base.lua). If you set fake_ingredients to a list of ingredients (using the same format as a regular ingredients list) then the recipe will produce scrap based on that list of ingredients rather than its actual one.
  • ScrapIndustry.categories[] currently only has two values, ignore=true which disables adding scrap byproducts to all recipes in that crafting category, (enabled for "smelting" by default) and self_scrap=true which works the same as it does for recipes but applies it to the entire category.
  • Fluid "scrap" byproducts are not supported yet. Recipes with only fluid products will also not have scrap byproducts generated by default (e.g. sulfuric acid).
  • Defining ScrapIndustry.products[] is optional, controls priority for scrap byproducts. If there are 4+ byproducts, the least important one is discarded.
  • NOTE: Plastic bits are optional, for now check settings.startup["scrap-industry-plastic"].value before adding it to anything. An API improvement is underway to make this more automatic.
  • Recipes are modified in data-final-fixes.lua, so make changes to ScrapIndustry before then, and either make changes in data-updates.lua, or preferably mark scrap-industry as a dependency and make your additions in data.lua
  • Duplicates are also created for hand-craft support by default. This is so they can be seamlessly crafted as intermediates.
  • See the lua files in the prototypes/compat/ folder for examples.
  • If you have any questions or API feature requests, feel free to DM me on the factorio forums or discord.

Credits: