From d2d1853c953fc6eebbfdeb9811b39cdd7bf00e6b Mon Sep 17 00:00:00 2001 From: hraukr Date: Fri, 12 Dec 2025 20:45:18 -0500 Subject: [PATCH 01/13] Updated README.md for the mod --- IntermediatesForYou2/README.md | 44 ++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/IntermediatesForYou2/README.md b/IntermediatesForYou2/README.md index 7db4260..0d02b5d 100644 --- a/IntermediatesForYou2/README.md +++ b/IntermediatesForYou2/README.md @@ -1,16 +1,46 @@ -# MetalsForYou +## IntermediatesForYou2 +[IntermediatesForYou](https://mods.factorio.com/mod/IntermediatesForYou) by [Timeken](https://mods.factorio.com/user/Timeken) updated for Factorio 2.0 -## Version History -See changelog.txt +Things in this mod may change. -## Created by +This mod is intended to be played with Timeken's other mods, BZ (and the BZ likes), K2, SE, 248k. +If you play with Brass Tacks and If I Had A Nickel it is recommended to enable their Hard mode settings as that is what this mod is balanced for right now. +#### New Intermediates -## Thanks to +- Turret base +- Large turret base +- Advanced electronic components +- Satellite body +- Spring +- Shock absorber +- Elementite [SE] +- Slag [K2/AAI] +- Imersite Powder [K2 & 248k] -### Compatibility +#### Changes & Compatibility (Likely an incomplete list) + +- Added Inserter Parts to stack filter inserter +- [K2] Greenhouse upgrades into Bio Lab +- [SE] Recycling recipe for long handed inserter +- [SE & 248k] Changed SE canister to use 248k fiber glass instead of glass and plastic +- [BZ] BZ Burner Chemical Plant upgrades into Chemical Plant +- Low quality advanced circuit recipe (for when you are low on gold) +- Filter Inserter upgrades into Stack Filter Inserter + +#### Planned Features (Maybe?) +- More late game SE and K2 support +- Customization settings +- Custom textures -### Localization +#### Created by: +Timeken (https://mods.factorio.com/user/Timeken) +Original Mod: https://mods.factorio.com/mod/IntermediatesForYou +#### Updated By +cackling.fiend (https://mods.factorio.com/user/cackling.fiend) +Hraukr (https://mods.factorio.com/user/Hraukr) +#### Based On +The BZ Mods series from brevven (https://mods.factorio.com/user/brevven) \ No newline at end of file From 7c3cc4172eff107fde60137037236b7e3adb69df Mon Sep 17 00:00:00 2001 From: msmods <44310958+msmods@users.noreply.github.com> Date: Fri, 12 Dec 2025 19:45:36 -0500 Subject: [PATCH 02/13] Fix recipe name for elementium-heat-shielding --- IntermediatesForYou2/locale/en/IntermediatesForYou.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg b/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg index b7241ef..1db9dbf 100644 --- a/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg +++ b/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg @@ -61,6 +61,7 @@ trace-rare-ore-extraction=Trace rare ore extraction elementite=Elementite elementite-dust=Elementite dust elementium-plate=Elementium plate +elementium-heat-shielding=Heat Shielding (Elementium) [recipe-description] low-quality-advanced-circuit=When resources are scarce you use what you got. \ No newline at end of file From 3dbe264abb74835c6ee8d6e7f64f3a207a5b5b1e Mon Sep 17 00:00:00 2001 From: msmods <44310958+msmods@users.noreply.github.com> Date: Fri, 12 Dec 2025 02:06:20 -0500 Subject: [PATCH 03/13] Fix recipe name and icon for bronze-spring --- .../locale/en/IntermediatesForYou.cfg | 1 + IntermediatesForYou2/prototypes/recipes.lua | 116 ++++++++++-------- 2 files changed, 66 insertions(+), 51 deletions(-) diff --git a/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg b/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg index 1db9dbf..ed5501c 100644 --- a/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg +++ b/IntermediatesForYou2/locale/en/IntermediatesForYou.cfg @@ -54,6 +54,7 @@ aluminium-hydroxide-smelting=Aluminium hydroxide smelting sodium-hydroxide-reaction=Sodium hydroxide reaction silica-extraction=Silica extraction sodium-aluminate=Sodium aluminate +bronze-spring=Spring (Bronze) slag=slag iron-extraction=Iron extraction diff --git a/IntermediatesForYou2/prototypes/recipes.lua b/IntermediatesForYou2/prototypes/recipes.lua index f3e878f..ae05024 100644 --- a/IntermediatesForYou2/prototypes/recipes.lua +++ b/IntermediatesForYou2/prototypes/recipes.lua @@ -87,6 +87,9 @@ if data.raw.item["rubber"] then table.insert(shock_absorber_ingredients, {type="item", name="rubber", amount=1}) end +local spring_icon = "__IntermediatesForYou2__/graphics/icons/spring.png" +local spring_icon_size = 64 + data:extend({ { type = "item", @@ -111,8 +114,8 @@ data:extend({ { type = "item", name = "spring", - icon = "__IntermediatesForYou2__/graphics/icons/spring.png", - icon_size = 64, + icon = spring_icon, + icon_size = spring_icon_size, group = "intermediate-product", subgroup = "intermediate-product", order = "a[spring]", @@ -196,60 +199,71 @@ util.add_unlock("rocket-silo","satellite-body") util.add_unlock("fast-inserter", "shock-absorber") if mods["bzfoundry2"] and data.raw.item["bronze-plate"] then -data:extend({ - { - type = "recipe", - name = "bronze-spring", - localised_name = { "item-name.bronze-spring" }, - category = "crafting", - order = "s2[spring]", - enabled = false, - energy_required = 2, - ingredients = {{type="item", name="bronze-plate", amount=1}}, - results = {{type="item", name="spring", amount=2}}, - } -}) + local bronze_plate_icon = data.raw.item["bronze-plate"].icon + or data.raw.item["bronze-plate"].icons and data.raw.item["bronze-plate"].icons[1].icon + local bronze_plate_icon_size = data.raw.item["bronze-plate"].icon_size + or data.raw.item["bronze-plate"].icons and data.raw.item["bronze-plate"].icons[1].icon_size + data:extend({ + { + type = "recipe", + name = "bronze-spring", + category = "crafting", + order = "s2[spring]", + icons = (data.raw.item["bronze-plate"] and + { + { icon = spring_icon, icon_size = spring_icon_size }, + { icon = bronze_plate_icon, icon_size = bronze_plate_icon_size, scale = 0.125, shift = { -8, -8 } } + } or { + { icon = spring_icon, icon_size = spring_icon_size } + } + ), + enabled = false, + energy_required = 2, + ingredients = {{type="item", name="bronze-plate", amount=1}}, + results = {{type="item", name="spring", amount=2}}, + } + }) util.add_unlock("foundry", "bronze-spring") end if mods["ThemTharHills-Updated"] then -local low_quality_advanced_circuit_ingredients = {{type="item", name="copper-cable", amount=3}, {type="item", name="electronic-circuit", amount=3}} -if data.raw.item["solder"] then - table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="solder", amount=4}) -end -if data.raw.item["kr-electronic-components"] then - table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="kr-electronic-components", amount=2}) -end -if data.raw.item["circuit-board"] then - table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="circuit-board", amount=1}) -end -local low_quality_advanced_circuit_results = {{ type = "item", name = "advanced-circuit", amount=1, probability=0.75}} -if mods["space-exploration"] then - table.insert(low_quality_advanced_circuit_results, { type = "item", name = "se-scrap", amount=1, probability=0.25}) -end + local low_quality_advanced_circuit_ingredients = {{type="item", name="copper-cable", amount=3}, {type="item", name="electronic-circuit", amount=3}} + if data.raw.item["solder"] then + table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="solder", amount=4}) + end + if data.raw.item["kr-electronic-components"] then + table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="kr-electronic-components", amount=2}) + end + if data.raw.item["circuit-board"] then + table.insert(low_quality_advanced_circuit_ingredients, {type="item", name="circuit-board", amount=1}) + end + local low_quality_advanced_circuit_results = {{ type = "item", name = "advanced-circuit", amount=1, probability=0.75}} + if mods["space-exploration"] then + table.insert(low_quality_advanced_circuit_results, { type = "item", name = "se-scrap", amount=1, probability=0.25}) + end -data:extend({ - { - type = "recipe", - name = "low-quality-advanced-circuit", - category = "crafting", - icons = (mods["Krastorio2"] and - { - { icon = "__base__/graphics/icons/advanced-circuit.png", icon_size = 64}, - { icon = "__base__/graphics/icons/copper-cable.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, - } or { - { icon = "__base__/graphics/icons/advanced-circuit.png", icon_size = 64}, - } - ), - main_product = "advanced-circuit", - order = "f", - enabled = false, - energy_required = 6, - ingredients = low_quality_advanced_circuit_ingredients, - results = low_quality_advanced_circuit_results, - } -}) -util.add_unlock("advanced-circuit", "low-quality-advanced-circuit") + data:extend({ + { + type = "recipe", + name = "low-quality-advanced-circuit", + category = "crafting", + icons = (mods["Krastorio2"] and + { + { icon = "__base__/graphics/icons/advanced-circuit.png", icon_size = 64}, + { icon = "__base__/graphics/icons/copper-cable.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, + } or { + { icon = "__base__/graphics/icons/advanced-circuit.png", icon_size = 64}, + } + ), + main_product = "advanced-circuit", + order = "f", + enabled = false, + energy_required = 6, + ingredients = low_quality_advanced_circuit_ingredients, + results = low_quality_advanced_circuit_results, + } + }) + util.add_unlock("advanced-circuit", "low-quality-advanced-circuit") end if mods["aai-industry"] or mods["Krastorio2"] then From 20d54e5c045ff901b394dec60ccc7b522c4fe16d Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 25 Dec 2025 22:26:27 +0100 Subject: [PATCH 04/13] Properly unlock bronze when foundry is disabled --- IntermediatesForYou2/prototypes/recipes.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IntermediatesForYou2/prototypes/recipes.lua b/IntermediatesForYou2/prototypes/recipes.lua index ae05024..64e4995 100644 --- a/IntermediatesForYou2/prototypes/recipes.lua +++ b/IntermediatesForYou2/prototypes/recipes.lua @@ -198,7 +198,7 @@ util.add_unlock("logistics", "spring") util.add_unlock("rocket-silo","satellite-body") util.add_unlock("fast-inserter", "shock-absorber") -if mods["bzfoundry2"] and data.raw.item["bronze-plate"] then +if data.raw.item["bronze-plate"] then local bronze_plate_icon = data.raw.item["bronze-plate"].icon or data.raw.item["bronze-plate"].icons and data.raw.item["bronze-plate"].icons[1].icon local bronze_plate_icon_size = data.raw.item["bronze-plate"].icon_size @@ -223,7 +223,11 @@ if mods["bzfoundry2"] and data.raw.item["bronze-plate"] then results = {{type="item", name="spring", amount=2}}, } }) - util.add_unlock("foundry", "bronze-spring") + if mods["bzfoundry2"] and not settings.startup["bzfoundry-minimal"].value then + util.add_unlock("foundry", "bronze-spring") + else + util.add_unlock("automation", "bronze-spring") + end end if mods["ThemTharHills-Updated"] then From 1991302758c915e11e54f3a4e87490e38a6fe865 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 25 Dec 2025 22:20:54 +0100 Subject: [PATCH 05/13] 2.0.6 --- IntermediatesForYou2/changelog.txt | 7 +++++++ IntermediatesForYou2/info.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/IntermediatesForYou2/changelog.txt b/IntermediatesForYou2/changelog.txt index 0aaaef0..b7f17de 100644 --- a/IntermediatesForYou2/changelog.txt +++ b/IntermediatesForYou2/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.6 +Date: 10.12.2025 + Bug Fixes: + - Fix recipe name for elementium-heat-shielding (thanks Hraukr) + - Fix recipe name and icon for bronze-spring (thanks Hraukr) + - Fix recipe unlock for bronze spring when foundry is disabled +--------------------------------------------------------------------------------------------------- Version: 2.0.5 Date: 10.12.2025 Bug Fixes: diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index 0106925..cbe09e2 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -1,6 +1,6 @@ { "name": "IntermediatesForYou2", - "version": "2.0.5", + "version": "2.0.6", "factorio_version": "2.0", "title": "IntermediatesForYou", "description": "This mod adds some intermediates and is intented to be played with my other mods.\n\nThis mod is inspired by Brevven's BZ mods.", From 8f09f25c61152fc3c3fe0b732cf488c653cf993b Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 25 Dec 2025 22:30:45 +0100 Subject: [PATCH 06/13] Move readme --- IntermediatesForYou2/README.md | 46 --------------------------------- README.md | 47 +++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 49 deletions(-) delete mode 100644 IntermediatesForYou2/README.md diff --git a/IntermediatesForYou2/README.md b/IntermediatesForYou2/README.md deleted file mode 100644 index 0d02b5d..0000000 --- a/IntermediatesForYou2/README.md +++ /dev/null @@ -1,46 +0,0 @@ -## IntermediatesForYou2 -[IntermediatesForYou](https://mods.factorio.com/mod/IntermediatesForYou) by [Timeken](https://mods.factorio.com/user/Timeken) updated for Factorio 2.0 - -Things in this mod may change. - -This mod is intended to be played with Timeken's other mods, BZ (and the BZ likes), K2, SE, 248k. -If you play with Brass Tacks and If I Had A Nickel it is recommended to enable their Hard mode settings as that is what this mod is balanced for right now. - -#### New Intermediates - -- Turret base -- Large turret base -- Advanced electronic components -- Satellite body -- Spring -- Shock absorber -- Elementite [SE] -- Slag [K2/AAI] -- Imersite Powder [K2 & 248k] - -#### Changes & Compatibility (Likely an incomplete list) - -- Added Inserter Parts to stack filter inserter -- [K2] Greenhouse upgrades into Bio Lab -- [SE] Recycling recipe for long handed inserter -- [SE & 248k] Changed SE canister to use 248k fiber glass instead of glass and plastic -- [BZ] BZ Burner Chemical Plant upgrades into Chemical Plant -- Low quality advanced circuit recipe (for when you are low on gold) -- Filter Inserter upgrades into Stack Filter Inserter - -#### Planned Features (Maybe?) - -- More late game SE and K2 support -- Customization settings -- Custom textures - -#### Created by: -Timeken (https://mods.factorio.com/user/Timeken) -Original Mod: https://mods.factorio.com/mod/IntermediatesForYou - -#### Updated By -cackling.fiend (https://mods.factorio.com/user/cackling.fiend) -Hraukr (https://mods.factorio.com/user/Hraukr) - -#### Based On -The BZ Mods series from brevven (https://mods.factorio.com/user/brevven) \ No newline at end of file diff --git a/README.md b/README.md index a4b1a3f..0d02b5d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,46 @@ -# IntermediatesForYou +## IntermediatesForYou2 +[IntermediatesForYou](https://mods.factorio.com/mod/IntermediatesForYou) by [Timeken](https://mods.factorio.com/user/Timeken) updated for Factorio 2.0 -Updated for Factorio 2.0. +Things in this mod may change. -Original mod: https://mods.factorio.com/mod/IntermediatesForYou \ No newline at end of file +This mod is intended to be played with Timeken's other mods, BZ (and the BZ likes), K2, SE, 248k. +If you play with Brass Tacks and If I Had A Nickel it is recommended to enable their Hard mode settings as that is what this mod is balanced for right now. + +#### New Intermediates + +- Turret base +- Large turret base +- Advanced electronic components +- Satellite body +- Spring +- Shock absorber +- Elementite [SE] +- Slag [K2/AAI] +- Imersite Powder [K2 & 248k] + +#### Changes & Compatibility (Likely an incomplete list) + +- Added Inserter Parts to stack filter inserter +- [K2] Greenhouse upgrades into Bio Lab +- [SE] Recycling recipe for long handed inserter +- [SE & 248k] Changed SE canister to use 248k fiber glass instead of glass and plastic +- [BZ] BZ Burner Chemical Plant upgrades into Chemical Plant +- Low quality advanced circuit recipe (for when you are low on gold) +- Filter Inserter upgrades into Stack Filter Inserter + +#### Planned Features (Maybe?) + +- More late game SE and K2 support +- Customization settings +- Custom textures + +#### Created by: +Timeken (https://mods.factorio.com/user/Timeken) +Original Mod: https://mods.factorio.com/mod/IntermediatesForYou + +#### Updated By +cackling.fiend (https://mods.factorio.com/user/cackling.fiend) +Hraukr (https://mods.factorio.com/user/Hraukr) + +#### Based On +The BZ Mods series from brevven (https://mods.factorio.com/user/brevven) \ No newline at end of file From 3f2c03d598445ce54385d00c839e9da44120a874 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 28 Jan 2026 23:23:29 +0100 Subject: [PATCH 07/13] advanced-electronic-components is only added if either MDbobelectronics2 or ThemTharHills-Updated is active --- IntermediatesForYou2/prototypes/recipes.lua | 46 +++++++++++---------- IntermediatesForYou2/recipe-modify.lua | 2 +- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/IntermediatesForYou2/prototypes/recipes.lua b/IntermediatesForYou2/prototypes/recipes.lua index 64e4995..2b5176a 100644 --- a/IntermediatesForYou2/prototypes/recipes.lua +++ b/IntermediatesForYou2/prototypes/recipes.lua @@ -17,28 +17,30 @@ if mods["Krastorio2"] then elseif mods["MDbobelectronics2"] then electronic_ingredients = {{type="item", name="kr-electronic-components", amount=1}, {type="item", name="intergrated-electronics", amount=2}, {type="item", name="processing-electronics", amount=1}} end - data:extend({ - { - type = "item", - name = "advanced-electronic-components", - icon = "__IntermediatesForYou2__/graphics/icons/advanced-electronic-components.png", - icon_size = 64, - group = "kr-electronic-components", - subgroup = "intermediate-product", - order = "e03", - stack_size = 100, - }, - { - type = "recipe", - name = "advanced-electronic-components", - category = "crafting", - order = "e03", - enabled = false, - energy_required = 4, - ingredients = electronic_ingredients, - results = {{type="item", name="advanced-electronic-components", amount=2}}, - } - }) + if mods["MDbobelectronics2"] or mods["ThemTharHills-Updated"] then + data:extend({ + { + type = "item", + name = "advanced-electronic-components", + icon = "__IntermediatesForYou2__/graphics/icons/advanced-electronic-components.png", + icon_size = 64, + group = "kr-electronic-components", + subgroup = "intermediate-product", + order = "e03", + stack_size = 100, + }, + { + type = "recipe", + name = "advanced-electronic-components", + category = "crafting", + order = "e03", + enabled = false, + energy_required = 4, + ingredients = electronic_ingredients, + results = {{type="item", name="advanced-electronic-components", amount=2}}, + } + }) + end if mods["248k-Redux"] then data:extend({ { diff --git a/IntermediatesForYou2/recipe-modify.lua b/IntermediatesForYou2/recipe-modify.lua index 2d52475..e80b3c4 100644 --- a/IntermediatesForYou2/recipe-modify.lua +++ b/IntermediatesForYou2/recipe-modify.lua @@ -143,7 +143,7 @@ if mods["bobassembly"] then end --electronics -if (mods["MDbobelectronics2"] and mods["Krastorio2"]) or false then +if mods["MDbobelectronics2"] and mods["Krastorio2"] then util.replace_ingredient("kr-electronic-components", "plastic-bar", "basic-electronic-components") util.replace_ingredient("kr-electronic-components", mods["Krastorio2"] and "kr-glass" or "glass", "BOBMD-electronic-components") util.remove_ingredient("kr-electronic-components", "silicon-wafer") From dc494be0d8f20689c8a288adb3125aae5e5a133b Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 20 Feb 2026 17:37:50 +0100 Subject: [PATCH 08/13] 2.0.7 --- IntermediatesForYou2/changelog.txt | 5 +++++ IntermediatesForYou2/info.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IntermediatesForYou2/changelog.txt b/IntermediatesForYou2/changelog.txt index b7f17de..3987cf6 100644 --- a/IntermediatesForYou2/changelog.txt +++ b/IntermediatesForYou2/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.7 +Date: 20.02.2026 + Bug Fixes: + - advanced-electronic-components is only added if either MDbobelectronics2 or ThemTharHills-Updated is active +--------------------------------------------------------------------------------------------------- Version: 2.0.6 Date: 10.12.2025 Bug Fixes: diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index cbe09e2..573590d 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -1,6 +1,6 @@ { "name": "IntermediatesForYou2", - "version": "2.0.6", + "version": "2.0.7", "factorio_version": "2.0", "title": "IntermediatesForYou", "description": "This mod adds some intermediates and is intented to be played with my other mods.\n\nThis mod is inspired by Brevven's BZ mods.", From 4f0eec1c2125c173cc2d7de15df47b8162b16548 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 12:46:54 +0100 Subject: [PATCH 09/13] Switch to bzlib --- IntermediatesForYou2/data-util.lua | 930 ------------------ IntermediatesForYou2/info.json | 1 + IntermediatesForYou2/prototypes/recipes.lua | 2 +- .../prototypes/se-recycling.lua | 2 +- .../prototypes/technology.lua | 2 +- IntermediatesForYou2/recipe-final-fix.lua | 2 +- IntermediatesForYou2/recipe-modify.lua | 2 +- 7 files changed, 6 insertions(+), 935 deletions(-) delete mode 100644 IntermediatesForYou2/data-util.lua diff --git a/IntermediatesForYou2/data-util.lua b/IntermediatesForYou2/data-util.lua deleted file mode 100644 index a20f4b8..0000000 --- a/IntermediatesForYou2/data-util.lua +++ /dev/null @@ -1,930 +0,0 @@ -local util = {} - --- se landfill --- params: ore, icon_size -function util.se_landfill(params) - if mods["space-exploration"] then - if not params.icon_size then params.icon_size = 64 end - local lname="landfill-"..params.ore - data:extend({ - { - type = "recipe", - icons = { - { icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 }, - { icon = "__Chromium2__/graphics/icons/"..params.ore..".png", icon_size = params.icon_size, scale = 0.33*64/params.icon_size}, - }, - energy_required = 1, - enabled=false, - name = lname, - category = "hard-recycling", - order = "z-b-"..params.ore, - subgroup = "terrain", - results = {{type="item", name="landfill", amount=1}}, - ingredients = {{type="item", name=params.ore, amount=50}}, - } - }) - util.add_unlock("se-recycling-facility", lname) - end -end - --- se matter --- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out -function util.se_matter(params) - if not params.quant_in then params.quant_in = params.quant_out end - if not params.icon_size then params.icon_size = 64 end - local fname = "matter-fusion-"..params.ore - local sedata = mods["Krastorio2"] and "se-kr-matter-synthesis-data" or "se-fusion-test-data" - local sejunk = mods["Krastorio2"] and "se-broken-data" or "se-junk-data" - data:extend({ - { - type = "recipe", - name = fname, - localised_name = {"recipe-name.se-matter-fusion-to", {"item-name."..params.ore}}, - category = "space-materialisation", - subgroup = "materialisation", - order = "a-b-z", - icons = { - {icon = "__space-exploration-graphics__/graphics/blank.png", - icon_size = 64, scale = 0.5}, - {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", - icon_size = 64, scale = 0.33, shift = {8,-8}}, - {icon = "__Chromium2__/graphics/icons/"..params.ore..".png", - icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={-8, 8}}, - {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", - icon_size = 64, scale = 0.5}, - }, - energy_required = params.energy_required, - enabled = false, - ingredients = { - {type = "item", name = sedata, amount=1}, - {type="fluid", name="se-particle-stream", amount=50}, - {type="fluid", name="se-space-coolant-supercooled", amount=25}, - }, - results = { - {type = "item", name = params.ore, amount = params.quant_out}, - {type="item", name="se-contaminated-scrap", amount=1}, - {type="item", name=sedata, amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity = 25, ignored_by_stats = 25}, - } - } - }) - util.add_unlock("se-space-matter-fusion", fname) - - if mods["Krastorio2"] then - local lname = params.ore.."-to-particle-stream" - data:extend({ - enabled = false, - { - type = "recipe", - name = lname, - localised_name = {"recipe-name.se-kr-matter-liberation", {"item-name."..params.ore}}, - category = "space-materialisation", - subgroup = "advanced-particle-stream", - order = "a-b-z", - icons = { - {icon = "__space-exploration-graphics__/graphics/blank.png", - icon_size = 64, scale = 0.5}, - {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", - icon_size = 64, scale = 0.33, shift = {-8,8}}, - {icon = "__Chromium2__/graphics/icons/"..params.ore..".png", - icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={8, -8}}, - {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", - icon_size = 64, scale = 0.5}, - }, - energy_required = 30, - enabled = false, - ingredients = { - {type="item", name="se-kr-matter-liberation-data", amount=1}, - {type="item", name=params.ore, amount=params.quant_in}, - {type="fluid", name="se-particle-stream", amount=50}, - }, - results = { - {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity = 50, ignored_by_stats = 50}, - } - } - }) - if not data.raw.technology["bz-advanced-stream-production"] then - data:extend({ - { - type = "technology", - name ="bz-advanced-stream-production", - localised_name = {"", {"technology-name.se-kr-advanced-stream-production"}, " 2"}, - icon = "__space-exploration-graphics__/graphics/technology/material-fabricator.png", - icon_size = 128, - effects = {}, - unit = { - count = 100, - time = 15, - ingredients = { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"se-rocket-science-pack", 1}, - {"space-science-pack", 1}, - {"production-science-pack", 1}, - {"utility-science-pack", 1}, - {"se-astronomic-science-pack-4", 1}, - {"se-energy-science-pack-4", 1}, - {"se-material-science-pack-4", 1}, - {"kr-matter-tech-card", 1}, - {"se-deep-space-science-pack-1", 1}, - } - }, - prerequisites = {"se-kr-advanced-stream-production"}, - }, - }) - end - util.add_unlock("bz-advanced-stream-production", lname) - end -end - --- Get the normal prototype for a recipe -- either .normal or the recipe itself -function util.get_normal(recipe_name) - if data.raw.recipe[recipe_name] then - recipe = data.raw.recipe[recipe_name] - if recipe.ingredients then - return recipe - end - end -end - --- Set/override a technology's prerequisites -function util.set_prerequisite(technology_name, prerequisites) - local technology = data.raw.technology[technology_name] - if technology then - technology.prerequisites = {} - for i, prerequisite in pairs(prerequisites) do - if data.raw.technology[prerequisite] then - table.insert(technology.prerequisites, prerequisite) - end - end - end -end - --- Add a prerequisite to a given technology -function util.add_prerequisite(technology_name, prerequisite) - local technology = data.raw.technology[technology_name] - if technology and data.raw.technology[prerequisite] then - if technology.prerequisites then - for i, pre in pairs(technology.prerequisites) do - if pre == prerequisite then return end - end - table.insert(technology.prerequisites, prerequisite) - else - technology.prerequisites = {prerequisite} - end - end -end - --- Remove a prerequisite from a given technology -function util.remove_prerequisite(technology_name, prerequisite) - local technology = data.raw.technology[technology_name] - local index = -1 - if technology then - for i, prereq in pairs(technology.prerequisites) do - if prereq == prerequisite then - index = i - break - end - end - if index > -1 then - table.remove(technology.prerequisites, index) - end - end -end - - --- Add an effect to a given technology -function util.add_effect(technology_name, effect) - local technology = data.raw.technology[technology_name] - if technology then - if not technology.effects then technology.effects = {} end - if effect and effect.type == "unlock-recipe" then - if not data.raw.recipe[effect.recipe] then - return - end - table.insert(technology.effects, effect) - end - end -end - --- Add an effect to a given technology to unlock recipe -function util.add_unlock(technology_name, recipe) - util.add_effect(technology_name, {type="unlock-recipe", recipe=recipe}) -end - --- remove recipe unlock effect from a given technology, multiple times if necessary -function util.remove_recipe_effect(technology_name, recipe_name) - local technology = data.raw.technology[technology_name] - local index = -1 - local cnt = 0 - if technology and technology.effects then - for i, effect in pairs(technology.effects) do - if effect.type == "unlock-recipe" and effect.recipe == recipe_name then - index = i - cnt = cnt + 1 - end - end - if index > -1 then - table.remove(technology.effects, index) - if cnt > 1 then -- not over yet, do it again - util.remove_recipe_effect(technology_name, recipe_name) - end - end - end -end - --- Set technology ingredients -function util.set_tech_recipe(technology_name, ingredients) - local technology = data.raw.technology[technology_name] - if technology then - technology.unit.ingredients = ingredients - end -end - -function util.set_enabled(recipe_name, enabled) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].enabled = enabled - end -end - -function util.set_hidden(recipe_name) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].hidden = true - end -end - --- Add a given quantity of ingredient to a given recipe -function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity) - if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then - add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - end -end - -function add_or_add_to_ingredient(recipe, ingredient, quantity) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing[1] == ingredient or existing.name == ingredient then - add_to_ingredient(recipe, ingredient, quantity) - return - end - end - table.insert(recipe.ingredients, {ingredient, quantity}) - end -end - --- Add a given quantity of ingredient to a given recipe -function util.add_ingredient(recipe_name, ingredient, quantity) - local is_fluid = not not data.raw.fluid[ingredient] - if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then - add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid) - end -end - -function add_ingredient(recipe, ingredient, quantity, is_fluid) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == ingredient then - return - end - end - if is_fluid then - table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity}) - else - table.insert(recipe.ingredients, {type = "item", name = ingredient, amount = quantity}) - end - end -end - --- Add a given ingredient prototype to a given recipe -function util.add_ingredient_raw(recipe_name, ingredient) - if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then - add_ingredient_raw(data.raw.recipe[recipe_name], ingredient) - end -end - -function add_ingredient_raw(recipe, ingredient) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if (existing.name and existing.name == ingredient.name) then - return - end - end - table.insert(recipe.ingredients, ingredient) - end -end - --- Set an ingredient to a given quantity -function util.set_ingredient(recipe_name, ingredient, quantity) - if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then - set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - end -end - -function set_ingredient(recipe, ingredient, quantity) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == ingredient then - existing.amount = quantity - existing.amount_min = nil - existing.amount_max = nil - return - end - end - table.insert(recipe.ingredients, {ingredient, quantity}) - end -end --- Add a given quantity of product to a given recipe. --- Only works for recipes with multiple products -function util.add_product(recipe_name, product) - if data.raw.recipe[recipe_name] and - (data.raw.item[product.name] or data.raw.fluid[product.name]) then - add_product(data.raw.recipe[recipe_name], product) - end -end - -function add_product(recipe, product) - if recipe ~= nil then - if recipe.results == nil then - recipe.results = {} - end - table.insert(recipe.results, product) - end -end - --- Get the amount of the ingredient, will check base/normal not expensive -function util.get_ingredient_amount(recipe_name, ingredient_name) - local recipe = data.raw.recipe[recipe_name] - if recipe then - if recipe.ingredients then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == ingredient_name then return ingredient.amount end - end - end - return 1 - end - return 0 -end - --- Get the amount of the result, will check base/normal not expensive -function util.get_amount(recipe_name, product) - if not product then product = recipe_name end - local recipe = data.raw.recipe[recipe_name] - if recipe then - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == product then return result.amount end - end - end - return 1 - end - return 0 -end - --- Replace one ingredient with another in a recipe --- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true. -function util.replace_ingredient(recipe_name, old, new, amount, multiply) - if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then - replace_ingredient(data.raw.recipe[recipe_name], old, new, amount or 1, multiply) - end -end - -function replace_ingredient(recipe, old, new, amount, multiply) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == new then - return - end - end - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - ingredient.name = new - if multiply then - ingredient.amount = amount * ingredient.amount - else - ingredient.amount = amount - end - end - end - end -end - --- Remove an ingredient from a recipe -function util.remove_ingredient(recipe_name, old) - if data.raw.recipe[recipe_name] then - remove_ingredient(data.raw.recipe[recipe_name], old) - end -end - -function remove_ingredient(recipe, old) - index = -1 - if recipe ~= nil and recipe.ingredients ~= nil then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - index = i - break - end - end - if index > -1 then - table.remove(recipe.ingredients, index) - end - end -end - --- Replace an amount of an ingredient in a recipe. Keep at least 1 of old. -function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount) - local is_fluid = not not data.raw.fluid[new] - if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then - replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) - end -end - -function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == new then - return - end - end - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - ingredient.amount = math.max(1, ingredient.amount - old_amount) - end - end - add_ingredient(recipe, new, new_amount, is_fluid) - end -end - --- set the amount of a product. -function util.set_product_amount(recipe_name, product, amount) - if data.raw.recipe[recipe_name] then - set_product_amount(data.raw.recipe[recipe_name], product, amount) - end -end - -function set_product_amount(recipe, product, amount) - if recipe then - if recipe.result_count then - recipe.result_count = amount - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == product then - if result.amount then - result.amount = amount - end - if result.amount_min ~= nil then - result.amount_min = nil - result.amount_max = nil - result.amount = amount - end - end - if result[1] == product then - result[2] = amount - end - end - end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = amount - end - end -end - --- multiply the cost, energy, and results of a recipe by a multiple -function util.multiply_recipe(recipe_name, multiple) - if data.raw.recipe[recipe_name] then - multiply_recipe(data.raw.recipe[recipe_name], multiple) - end -end - -function multiply_recipe(recipe, multiple) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required * multiple - end - if recipe.result_count then - recipe.result_count = recipe.result_count * multiple - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name then - if result.amount then - result.amount = result.amount * multiple - end - if result.amount_min ~= nil then - result.amount_min = result.amount_min * multiple - result.amount_max = result.amount_max * multiple - end - if result.catalyst_amount then - result.catalyst_amount = result.catalyst_amount * multiple - end - end - if result[1] then - result[2] = result[2] * multiple - end - end - end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = multiple - end - if recipe.ingredients then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name then - ingredient.amount = ingredient.amount * multiple - end - if ingredient[1] then - ingredient[2] = ingredient[2] * multiple - end - end - end - end -end - --- Returns true if a recipe has an ingredient -function util.has_ingredient(recipe_name, ingredient) - return data.raw.recipe[recipe_name] and - has_ingredient(data.raw.recipe[recipe_name], ingredient) -end - -function has_ingredient(recipe, ingredient) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing[1] == ingredient or existing.name == ingredient then - return true - end - end - end - return false -end - --- Remove a product from a recipe, WILL NOT remove the only product -function util.remove_product(recipe_name, old) - if data.raw.recipe[recipe_name] then - remove_product(data.raw.recipe[recipe_name], old) - end -end - -function remove_product(recipe, old) - index = -1 - if recipe ~= nil and recipe.results ~= nil then - for i, result in pairs(recipe.results) do - if result.name == old or result[1] == old then - index = i - break - end - end - if index > -1 then - table.remove(recipe.results, index) - end - end -end - -function util.set_main_product(recipe_name, product) - if data.raw.recipe[recipe_name] then - set_main_product(data.raw.recipe[recipe_name], product) - end -end - -function set_main_product(recipe, product) - if recipe then - recipe.main_product = product - end -end - --- Replace one product with another in a recipe -function util.replace_product(recipe_name, old, new) - if data.raw.recipe[recipe_name] then - replace_product(data.raw.recipe[recipe_name], old, new) - end -end - -function replace_product(recipe, old, new) - if recipe then - if recipe.main_product == old then - recipe.main_product = new - end - if recipe.result == old then - recipe.result = new - return - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == old then result.name = new end - if result[1] == old then result[1] = new end - end - end - end -end - --- Remove an element of type t and name from data.raw -function util.remove_raw(t, name) - if not data.raw[t] then - log(t.." not found in data.raw") - return - end - if data.raw[t][name] then - for i, elem in pairs(data.raw[t]) do - if elem.name == name then - data.raw[t][i] = nil - break - end - end - end -end - --- Set energy required -function util.set_recipe_time(recipe_name, time) - if data.raw.recipe[recipe_name] then - set_recipe_time(data.raw.recipe[recipe_name], time) - end -end - -function set_recipe_time(recipe, time) - if recipe then - if recipe.energy_required then - recipe.energy_required = time - end - end -end - --- Multiply energy required -function util.multiply_time(recipe_name, factor) - if data.raw.recipe[recipe_name] then - multiply_time(data.raw.recipe[recipe_name], factor) - end -end - -function multiply_time(recipe, factor) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required * factor - end - end -end - --- Add to energy required -function util.add_time(recipe_name, amount) - if data.raw.recipe[recipe_name] then - add_time(data.raw.recipe[recipe_name], amount) - end -end - -function add_time(recipe, amount) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required + amount - end - end -end - --- Set recipe category -function util.set_category(recipe_name, category) - if data.raw.recipe[recipe_name] and data.raw["recipe-category"][category] then - data.raw.recipe[recipe_name].category = category - end -end - --- Set recipe subgroup -function util.set_subgroup(recipe_name, subgroup) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].subgroup = subgroup - end -end - --- Set item subgroup -function util.set_item_subgroup(item, subgroup) - if data.raw.item[item] and data.raw["item-subgroup"][subgroup] then - data.raw.item[item].subgroup = subgroup - end -end - -function util.add_icon(recipe_name, icon) - if data.raw.recipe[recipe_name] then - if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.recipe[recipe_name].icon, - icon_size=data.raw.recipe[recipe_name].icon_size, - icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps, - }} - data.raw.recipe[recipe_name].icon = nil - data.raw.recipe[recipe_name].icon_size = nil - end - table.insert(data.raw.recipe[recipe_name].icons, icon) - end -end - --- Set recipe icons -function util.set_icons(recipe_name, icons) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].icons = icons - data.raw.recipe[recipe_name].icon = nil - data.raw.recipe[recipe_name].icon_size = nil - end -end - --- Set recipe icons -function util.set_item_icons(item_name, icons) - if data.raw.item[item_name] then - data.raw.item[item_name].icons = icons - data.raw.item[item_name].icon = nil - data.raw.item[item_name].icon_size = nil - end -end - --- Gets an item or fluid icon -function util.get_item_or_fluid_icon(name) - icon = "" - if data.raw.item[name] then - icon = data.raw.item[name].icon - if not icon then icon = data.raw.item[name].icons[1].icon end - elseif data.raw.fluid[name] then - icon = data.raw.fluid[name].icon - if not icon then icon = data.raw.fluid[name].icons[1].icon end - end - return icon -end - -function util.set_to_founding(recipe) - util.set_category(recipe, "founding") - util.set_subgroup(recipe, "foundry-intermediate") -end - --- Add crafting category to an entity -function util.add_crafting_category(entity_type, entity, category) - if data.raw[entity_type][entity] and data.raw["recipe-category"][category] then - for i, existing in pairs(data.raw[entity_type][entity].crafting_categories) do - if existing == category then - return - end - end - table.insert(data.raw[entity_type][entity].crafting_categories, category) - end -end - -function util.add_to_ingredient(recipe, ingredient, amount) - if data.raw.recipe[recipe] then - add_to_ingredient(data.raw.recipe[recipe], ingredient, amount) - end -end - -function add_to_ingredient(recipe, it, amount) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == it then - ingredient.amount = ingredient.amount + amount - return - end - if ingredient[1] == it then - ingredient[2] = ingredient[2] + amount - return - end - end - end -end - -function util.add_to_product(recipe_name, product, amount) - if data.raw.recipe[recipe_name] then - add_to_product(data.raw.recipe[recipe_name], product, amount) - end -end - -function add_to_product(recipe, product, amount) - if recipe ~= nil and recipe.results ~= nil then - if recipe.result == product then - recipe.result_count = recipe.result_count + amount - return - end - for i, result in pairs(recipe.results) do - if result.name == product then - result.amount = result.amount + amount - return - end - if result[1] == product then - result[2] = result[2] + amount - return - end - end - end -end - --- Adds a result to a mineable type -function util.add_minable_result(t, name, result) - if data.raw[t] and data.raw[t][name] and data.raw[t][name].minable then - if data.raw[t][name].minable.result and not data.raw[t][name].minable.results then - data.raw[t][name].minable.results = { - {data.raw[t][name].minable.result ,data.raw[t][name].minable.count}} - data.raw[t][name].minable.result = nil - data.raw[t][name].minable.result_count = nil - end - if data.raw[t][name].minable.results then - table.insert(data.raw[t][name].minable.results, result) - end - end -end - -function util.remove_prior_unlocks(tech, recipe) - if data.raw.technology[tech].prerequisites then - for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - remove_prior_unlocks(prerequisite, recipe) - end - end -end - -function remove_prior_unlocks(tech, recipe) - local technology = data.raw.technology[tech] - if technology then - util.remove_recipe_effect(tech, recipe) - if technology.prerequisites then - for i, prerequisite in pairs(technology.prerequisites) do - -- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :| - remove_prior_unlocks(prerequisite, recipe) - end - end - end -end - -function util.replace_ingredients_prior_to(tech, old, new, multiplier) - if not data.raw.technology[tech] then - log("Not replacing ingredient "..old.." with "..new.." because tech "..tech.." was not found") - return - end - util.remove_prior_unlocks(tech, old) - for i, recipe in pairs(data.raw.recipe) do - if (recipe.enabled and recipe.enabled ~= false) - and (not recipe.hidden or recipe.hidden == true) -- probably don't want to change hidden recipes - and string.sub(recipe.name, 1, 3) ~= 'se-' -- have to exlude SE in general :( - then - -- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name) -- Handy Debug :| - util.replace_ingredient(recipe.name, old, new, multiplier, true) - end - end - if data.raw.technology[tech].prerequisites then - for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - replace_ingredients_prior_to(prerequisite, old, new, multiplier) - end - end -end - -function replace_ingredients_prior_to(tech, old, new, multiplier) - local technology = data.raw.technology[tech] - if technology then - if technology.effects then - for i, effect in pairs(technology.effects) do - if effect.type == "unlock-recipe" then - -- log("BZZZ replacing " .. old .. " with " .. new .." in " .. effect.recipe) -- Handy Debug :| - util.replace_ingredient(effect.recipe, old, new, multiplier, true) - end - end - end - if technology.prerequisites then - for i, prerequisite in pairs(technology.prerequisites) do - -- log("BZZZ checking " .. prerequisite) -- Handy Debug :| - replace_ingredients_prior_to(prerequisite, old, new, multiplier) - end - end - end -end - -function util.remove_all_recipe_effects(recipe_name) - for name, _ in pairs(data.raw.technology) do - util.remove_recipe_effect(name, recipe_name) - end -end - -function util.add_unlock_force(technology_name, recipe) - util.set_enabled(recipe, false) - util.remove_all_recipe_effects(recipe) - util.add_unlock(technology_name, recipe) -end - --- sum the products of a recipe -function util.sum_products(recipe_name) - -- this is going to end up approximate in some cases, integer division is probs fine - if data.raw.recipe[recipe_name] then - local recipe = data.raw.recipe[recipe_name] - if not recipe.results then return recipe.result_count end - local sum = 0 - for i, result in pairs(recipe.results) do - local amt = 0 - if result[2] then amt = result[2] - elseif result.amount then amt = result.amount - elseif result.amount_min then amt = (result.amount_min + result.amount_max)/2 - end - if result.probability then amt = amt * result.probability end - sum = sum + amt - end - return sum - end - return 0 -end - -function util.add_productivity(recipe) - data.raw.recipe[recipe].allow_productivity = true -end - -return util \ No newline at end of file diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index 573590d..155c8d4 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -8,6 +8,7 @@ "homepage": "https://discord.gg/ufvFUJtVwk", "dependencies": [ "base >= 2.0.0", + "bzlib", "? 248k-Redux", "? aai-industry", "? bismuth", diff --git a/IntermediatesForYou2/prototypes/recipes.lua b/IntermediatesForYou2/prototypes/recipes.lua index 2b5176a..2ef1f93 100644 --- a/IntermediatesForYou2/prototypes/recipes.lua +++ b/IntermediatesForYou2/prototypes/recipes.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") local turret_base_ingredients = {{type="item", name="iron-plate", amount=10}, {type="item", name="iron-gear-wheel", amount=10}} if mods["Krastorio2"] and mods["aai-industry"] then diff --git a/IntermediatesForYou2/prototypes/se-recycling.lua b/IntermediatesForYou2/prototypes/se-recycling.lua index 346168e..a81a93c 100644 --- a/IntermediatesForYou2/prototypes/se-recycling.lua +++ b/IntermediatesForYou2/prototypes/se-recycling.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["space-exploration"] then local se_recycle_long_handed_inserter_results = {{type="item", name="iron-stick", amount=1}, {type="item", name="inserter", amount=1, probability=0.75}} if data.raw.item["solder"] then diff --git a/IntermediatesForYou2/prototypes/technology.lua b/IntermediatesForYou2/prototypes/technology.lua index c1f756b..52c9d75 100644 --- a/IntermediatesForYou2/prototypes/technology.lua +++ b/IntermediatesForYou2/prototypes/technology.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["aai-industry"] or mods["Krastorio2"] then data:extend( diff --git a/IntermediatesForYou2/recipe-final-fix.lua b/IntermediatesForYou2/recipe-final-fix.lua index 6380420..93a7c27 100644 --- a/IntermediatesForYou2/recipe-final-fix.lua +++ b/IntermediatesForYou2/recipe-final-fix.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["MDbobelectronics2"] then util.remove_ingredient("advanced-processing-unit", "processing-electronics") diff --git a/IntermediatesForYou2/recipe-modify.lua b/IntermediatesForYou2/recipe-modify.lua index e80b3c4..098051c 100644 --- a/IntermediatesForYou2/recipe-modify.lua +++ b/IntermediatesForYou2/recipe-modify.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") -- Main vanilla changes util.add_ingredient("flamethrower-turret", "turret-base", 1) From bbb30583776c61177302b5c85c1b9eb69950b0ab Mon Sep 17 00:00:00 2001 From: Morganite Date: Mon, 23 Feb 2026 22:27:37 -0600 Subject: [PATCH 10/13] 248k update fixes --- IntermediatesForYou2/info.json | 2 +- IntermediatesForYou2/prototypes/recipes.lua | 4 ++-- IntermediatesForYou2/recipe-final-fix.lua | 2 +- IntermediatesForYou2/recipe-modify.lua | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index 155c8d4..c5fc88e 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -9,7 +9,7 @@ "dependencies": [ "base >= 2.0.0", "bzlib", - "? 248k-Redux", + "? 248k-Redux >= 0.1.35", "? aai-industry", "? bismuth", "? Bio_Industries_2", diff --git a/IntermediatesForYou2/prototypes/recipes.lua b/IntermediatesForYou2/prototypes/recipes.lua index 2ef1f93..cd25ffe 100644 --- a/IntermediatesForYou2/prototypes/recipes.lua +++ b/IntermediatesForYou2/prototypes/recipes.lua @@ -55,7 +55,7 @@ if mods["Krastorio2"] then order = "a-a-a-1", enabled = false, energy_required = 4, - ingredients = {{type="item", name="fu_materials_energy_charged_crystal", amount=1}}, + ingredients = {{type="item", name="fu_energy_charged_crystal", amount=1}}, results = {{type="item", name="kr-imersite-powder", amount=2}}, } }) @@ -81,7 +81,7 @@ if data.raw.item["gimbaled-thruster"] then table.insert(satellite_body_ingredients, {type="item", name="gimbaled-thruster", amount=10}) end if mods["248k-Redux"] then - table.insert(satellite_body_ingredients, {type="item", name="fu_materials_KFK", amount=10}) + table.insert(satellite_body_ingredients, {type="item", name="fu_KFK", amount=10}) end local shock_absorber_ingredients = {{type="item", name="spring", amount=1}, {type="item", name="iron-stick", amount=1}} diff --git a/IntermediatesForYou2/recipe-final-fix.lua b/IntermediatesForYou2/recipe-final-fix.lua index 93a7c27..06cf457 100644 --- a/IntermediatesForYou2/recipe-final-fix.lua +++ b/IntermediatesForYou2/recipe-final-fix.lua @@ -38,7 +38,7 @@ if mods["space-exploration"] then end if mods["248k-Redux"] then - util.replace_ingredient("se-canister", "plastic-bar", "fi_materials_GFK", 5) + util.replace_ingredient("se-canister", "plastic-bar", "fi_GFK", 5) util.remove_ingredient("se-canister", mods["Krastorio2"] and "kr-glass" or "glass") end end \ No newline at end of file diff --git a/IntermediatesForYou2/recipe-modify.lua b/IntermediatesForYou2/recipe-modify.lua index 098051c..80a5b1d 100644 --- a/IntermediatesForYou2/recipe-modify.lua +++ b/IntermediatesForYou2/recipe-modify.lua @@ -221,7 +221,7 @@ if mods["space-exploration"] then end if mods["248k-Redux"] then - util.replace_ingredient("se-canister", "plastic-bar", "fi_materials_GFK", 5) + util.replace_ingredient("se-canister", "plastic-bar", "fi_GFK", 5) util.remove_ingredient("se-canister", mods["Krastorio2"] and "kr-glass" or "glass") util.add_ingredient("effectivity-module-2", "el_lithium_battery", 10) From 5c78bbf6cd5995d059ab6895b06750ba68425763 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 13:18:03 +0100 Subject: [PATCH 11/13] 2.1.0 --- IntermediatesForYou2/changelog.txt | 7 +++++++ IntermediatesForYou2/info.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/IntermediatesForYou2/changelog.txt b/IntermediatesForYou2/changelog.txt index 3987cf6..c9e43ad 100644 --- a/IntermediatesForYou2/changelog.txt +++ b/IntermediatesForYou2/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.0 +Date: 11.03.2026 + Changes: + - Switch to bzlib - Please install the new dependency + Bug Fixes: + - 248k: Fixes for 0.1.35 breaking changes (thanks Morganite) +--------------------------------------------------------------------------------------------------- Version: 2.0.7 Date: 20.02.2026 Bug Fixes: diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index c5fc88e..d4a01eb 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -1,6 +1,6 @@ { "name": "IntermediatesForYou2", - "version": "2.0.7", + "version": "2.1.0", "factorio_version": "2.0", "title": "IntermediatesForYou", "description": "This mod adds some intermediates and is intented to be played with my other mods.\n\nThis mod is inspired by Brevven's BZ mods.", From 0430fc2a04a1c922ecaf826c247b69214988928f Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 23:14:32 +0100 Subject: [PATCH 12/13] Correct renamed "efficiency-module" --- IntermediatesForYou2/recipe-final-fix.lua | 4 ++-- IntermediatesForYou2/recipe-modify.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/IntermediatesForYou2/recipe-final-fix.lua b/IntermediatesForYou2/recipe-final-fix.lua index 06cf457..8f05fc1 100644 --- a/IntermediatesForYou2/recipe-final-fix.lua +++ b/IntermediatesForYou2/recipe-final-fix.lua @@ -28,11 +28,11 @@ if mods["space-exploration"] then util.remove_ingredient("productivity-module-3", "integrated-circuit") - util.remove_ingredient("effectivity-module-3", "integrated-circuit") + util.remove_ingredient("efficiency-module-3", "integrated-circuit") util.remove_ingredient("productivity-module-2", "electronic-circuit") - util.remove_ingredient("effectivity-module-2", "electronic-circuit") + util.remove_ingredient("efficiency-module-2", "electronic-circuit") if mods["BrassTacks-Updated"] then util.add_product("se-core-fragment-omni",{ type = "item", name = "zinc-ore", amount = 8 }) end diff --git a/IntermediatesForYou2/recipe-modify.lua b/IntermediatesForYou2/recipe-modify.lua index 80a5b1d..d6209bf 100644 --- a/IntermediatesForYou2/recipe-modify.lua +++ b/IntermediatesForYou2/recipe-modify.lua @@ -206,8 +206,8 @@ if mods["space-exploration"] then util.remove_ingredient("productivity-module-3", "mlcc") util.remove_ingredient("productivity-module-3", "cooling-fan") - util.remove_ingredient("effectivity-module-3", "mlcc") - util.remove_ingredient("effectivity-module-3", "cooling-fan") + util.remove_ingredient("efficiency-module-3", "mlcc") + util.remove_ingredient("efficiency-module-3", "cooling-fan") util.set_ingredient("speed-module-4", "se-iridium-plate", 90) util.add_ingredient("speed-module-4", "elementium-plate", 30) @@ -224,7 +224,7 @@ if mods["space-exploration"] then util.replace_ingredient("se-canister", "plastic-bar", "fi_GFK", 5) util.remove_ingredient("se-canister", mods["Krastorio2"] and "kr-glass" or "glass") - util.add_ingredient("effectivity-module-2", "el_lithium_battery", 10) + util.add_ingredient("efficiency-module-2", "el_lithium_battery", 10) end end From ee4bef4f1c572a828e74b1ec2af90b55d3ed5b30 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 16 Mar 2026 21:51:52 +0100 Subject: [PATCH 13/13] 2.1.1 --- IntermediatesForYou2/changelog.txt | 5 +++++ IntermediatesForYou2/info.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/IntermediatesForYou2/changelog.txt b/IntermediatesForYou2/changelog.txt index c9e43ad..a26f89e 100644 --- a/IntermediatesForYou2/changelog.txt +++ b/IntermediatesForYou2/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.1 +Date: 16.03.2026 + Bug Fixes: + - Correct renamed "efficiency-module" +--------------------------------------------------------------------------------------------------- Version: 2.1.0 Date: 11.03.2026 Changes: diff --git a/IntermediatesForYou2/info.json b/IntermediatesForYou2/info.json index d4a01eb..76496d9 100644 --- a/IntermediatesForYou2/info.json +++ b/IntermediatesForYou2/info.json @@ -1,6 +1,6 @@ { "name": "IntermediatesForYou2", - "version": "2.1.0", + "version": "2.1.1", "factorio_version": "2.0", "title": "IntermediatesForYou", "description": "This mod adds some intermediates and is intented to be played with my other mods.\n\nThis mod is inspired by Brevven's BZ mods.",