From 3d15a431f2324630f918b76e747f3f42f6fea898 Mon Sep 17 00:00:00 2001 From: pla Date: Tue, 28 Oct 2025 09:16:11 +0100 Subject: [PATCH 01/10] Fix early tech tree without K2 --- bzgas2/data-final-fixes.lua | 21 +++++++++++++++------ bzgas2/data-util.lua | 9 +++++++++ bzgas2/data.lua | 2 +- bzgas2/prototypes/bakelite.lua | 1 + bzgas2/prototypes/gas-extractor.lua | 12 +++++------- bzgas2/prototypes/phenol.lua | 11 +++-------- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/bzgas2/data-final-fixes.lua b/bzgas2/data-final-fixes.lua index ad08a6f..70ec7e8 100644 --- a/bzgas2/data-final-fixes.lua +++ b/bzgas2/data-final-fixes.lua @@ -2,7 +2,7 @@ require("stacking") require("modules") require("compatibility/ir2") -local util = require("data-util"); +local util = require("__bzgas2__/data-util") -- core mining balancing util.set_product_amount("se-core-fragment-omni", "gas", 24) @@ -30,13 +30,22 @@ if not mods.Krastorio2 and not mods["aai-industry"] and not mods.bzaluminum2 and util.add_ingredient("repair-pack", "copper-cable", 6) util.set_ingredient("repair-pack", "iron-gear-wheel", 3) - util.add_unlock_force("electronics", "electronic-circuit") - util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" }) + -- New for 2.0 (Evilpla) + util.remove_prerequisite("automation", "automation-science-pack") + util.set_tech_trigger("automation", { type = "mine-entity", entity = "coal" }) + util.set_tech_trigger("gas-extraction", { type = "craft-item", item = "copper-plate" }) + util.set_tech_trigger("basic-chemistry", { type = "mine-entity", entity = "gas" }) + util.set_tech_trigger("bakelite", { type = "craft-fluid", fluid = "formaldehyde" }) + util.set_tech_trigger("electronics", { type = "craft-item", item = "bakelite" }) util.add_effect("electronics", { type = "unlock-recipe", recipe = "long-handed-inserter" }) util.remove_recipe_effect("automation", "long-handed-inserter") - util.set_enabled("electronic-circuit", false) - util.set_enabled("inserter", false) - util.add_prerequisite("logistic-science-pack", "electronics") + + -- TODO: cleanup + -- util.add_unlock_force("electronics", "electronic-circuit") + -- util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" }) + -- util.set_enabled("electronic-circuit", false) + -- util.set_enabled("inserter", false) + -- util.add_prerequisite("logistic-science-pack", "electronics") end if not mods.bzaluminum2 and not mods["bzcarbon2"] then util.replace_ingredients_prior_to("electronics", "electronic-circuit", "copper-cable", 2) diff --git a/bzgas2/data-util.lua b/bzgas2/data-util.lua index ff75c36..5dbd855 100644 --- a/bzgas2/data-util.lua +++ b/bzgas2/data-util.lua @@ -1267,4 +1267,13 @@ function util.set_vtk_dcm_ingredients() end end +-- Set technology trigger +function util.set_tech_trigger(technology_name, trigger) + local technology = data.raw.technology[technology_name] + if technology then + technology.unit = nil + technology.research_trigger = trigger + end +end + return util diff --git a/bzgas2/data.lua b/bzgas2/data.lua index 26625fe..6c2e79d 100644 --- a/bzgas2/data.lua +++ b/bzgas2/data.lua @@ -1,7 +1,7 @@ require("prototypes/gas") require("prototypes/gas-extractor") -require("prototypes/phenol") require("prototypes/formaldehyde") +require("prototypes/phenol") require("prototypes/bakelite") require("prototypes/basic-chemical-plant") require("prototypes/k2-recipe") diff --git a/bzgas2/prototypes/bakelite.lua b/bzgas2/prototypes/bakelite.lua index 83a7a9d..1b15bd2 100644 --- a/bzgas2/prototypes/bakelite.lua +++ b/bzgas2/prototypes/bakelite.lua @@ -15,6 +15,7 @@ data:extend({ name = "bakelite", category = "chemistry", main_product = "bakelite", + allow_productivity = true, enabled = false, ingredients = { {type = "item", name = util.me.use_phenol() and "phenol" or "coal", amount = 1}, diff --git a/bzgas2/prototypes/gas-extractor.lua b/bzgas2/prototypes/gas-extractor.lua index 156b547..d749ae7 100644 --- a/bzgas2/prototypes/gas-extractor.lua +++ b/bzgas2/prototypes/gas-extractor.lua @@ -1,4 +1,4 @@ -local util = require("data-util"); +local util = require("data-util") local futil = require("util") local ge_ingredients = { @@ -14,9 +14,6 @@ if mods.Krastorio2 then elseif mods["aai-industry"] then table.insert(ge_ingredients, {type="item", name="sand", amount=10}) ge_prereq = {"sand-processing"} -elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then - table.insert(ge_ingredients, {type="item", name="silica", amount=20}) - ge_prereq = {"silica-processing"} end drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create_vector @@ -46,7 +43,7 @@ data:extend({ type = "recipe", name = "gas-extractor", results = {{ type = "item", name = "gas-extractor", amount = 1}}, - enabled = false, -- TODO change + enabled = false, ingredients = ge_ingredients, }, { @@ -54,7 +51,7 @@ data:extend({ name = "gas-extraction", icon = "__bzgas2__/graphics/technology/gas-processing.png", icon_size = 256, - --prerequisites = ge_prereq, + prerequisites = ge_prereq, effects = { {type = "unlock-recipe", recipe = "gas-extractor"}, }, @@ -87,11 +84,12 @@ data:extend({ }, output_fluid_box = { - volume = 1000, + volume = 100, pipe_covers = pipecoverspictures(), pipe_connections = { { + flow_direction = "output", direction = defines.direction.north, positions = { {0, -1}, {1, 0}, {0, 1}, {-1, 0} } } diff --git a/bzgas2/prototypes/phenol.lua b/bzgas2/prototypes/phenol.lua index 538bada..ad83ed6 100644 --- a/bzgas2/prototypes/phenol.lua +++ b/bzgas2/prototypes/phenol.lua @@ -1,4 +1,4 @@ -local util = require("data-util"); +local util = require("data-util") if util.me.use_phenol() then @@ -66,13 +66,8 @@ if data.raw.item[mods["Krastorio2"] and "kr-coke" or "coke"] then } }) end - if mods.Krastorio2 then - util.add_effect("steel-processing", {type="unlock-recipe", recipe="phenol"}) - elseif data.raw.item["foundry"] then - util.add_effect("foundry", {type="unlock-recipe", recipe="phenol"}) - else - util.add_effect("basic-chemistry", {type="unlock-recipe", recipe="phenol"}) - end + + util.add_effect("basic-chemistry", {type="unlock-recipe", recipe="phenol"}) if mods.Krastorio2 then light_oil_icon = { icon = "__Krastorio2Assets__/icons/fluids/light-oil.png", icon_size = 64, icon_mipmaps = 4, scale=0.25, shift={-8,-8}} From 3a045a5cbae92f2d0b56c419eb280543c4d0b095 Mon Sep 17 00:00:00 2001 From: pla Date: Tue, 28 Oct 2025 10:04:49 +0100 Subject: [PATCH 02/10] Fix K2 matter recipe generation and tech icon --- bzgas2/matter.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bzgas2/matter.lua b/bzgas2/matter.lua index acf60cf..2b5e943 100644 --- a/bzgas2/matter.lua +++ b/bzgas2/matter.lua @@ -17,9 +17,10 @@ data:extend( { icon = "__bzgas2__/graphics/icons/gas.png", icon_size = 128, - scale = 1.4, + scale = 0.7, } }, + effects ={}, prerequisites = {"kr-matter-processing"}, unit = { @@ -40,8 +41,8 @@ local gas_ore_matter = material = { type = "fluid", name = "gas", amount = 100 }, matter_count = 5, energy_required = 1, - need_stabilizer = false, - unlocked_by_technology = "gas-matter-processing" + needs_stabilizer = false, + unlocked_by = "gas-matter-processing" } matter.make_recipes(gas_ore_matter) end From 5c7fc47c3423563cd3853f4afba84e90b0d50b12 Mon Sep 17 00:00:00 2001 From: pla Date: Fri, 31 Oct 2025 17:29:56 +0100 Subject: [PATCH 03/10] set proper subgoup for liquids --- bzgas2/prototypes/formaldehyde.lua | 3 ++- bzgas2/prototypes/gas.lua | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bzgas2/prototypes/formaldehyde.lua b/bzgas2/prototypes/formaldehyde.lua index 36b0be4..3880d8b 100644 --- a/bzgas2/prototypes/formaldehyde.lua +++ b/bzgas2/prototypes/formaldehyde.lua @@ -1,4 +1,4 @@ -local util = require("data-util"); +local util = require("data-util") -- data:extend({ -- { @@ -11,6 +11,7 @@ data:extend({ { type = "fluid", name = "formaldehyde", + subgroup = "fluid", default_temperature = 25, heat_capacity = "0.1kJ", fuel_value = "0.5kJ", diff --git a/bzgas2/prototypes/gas.lua b/bzgas2/prototypes/gas.lua index 3a9325c..c394409 100644 --- a/bzgas2/prototypes/gas.lua +++ b/bzgas2/prototypes/gas.lua @@ -1,6 +1,6 @@ -local resource_autoplace = require('resource-autoplace'); +local resource_autoplace = require('resource-autoplace') -local util = require("data-util"); +local util = require("data-util") local futil = require("util") data.raw.planet.nauvis.map_gen_settings.autoplace_controls["gas"] = {} @@ -104,6 +104,7 @@ data:extend({ { type = "fluid", name = "gas", + subgroup = "fluid", default_temperature = 25, heat_capacity = "0.1kJ", fuel_value = "1000kJ", From 3ba05c70c2a094e0a929dd59e5251e96c349a21f Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 4 Nov 2025 23:15:56 +0100 Subject: [PATCH 04/10] Fix early game technologies with only bzgas --- bzgas2/data-final-fixes.lua | 22 ++++++++++++++++++++-- bzgas2/prototypes/gas-extractor.lua | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/bzgas2/data-final-fixes.lua b/bzgas2/data-final-fixes.lua index ad08a6f..b23574f 100644 --- a/bzgas2/data-final-fixes.lua +++ b/bzgas2/data-final-fixes.lua @@ -30,13 +30,31 @@ if not mods.Krastorio2 and not mods["aai-industry"] and not mods.bzaluminum2 and util.add_ingredient("repair-pack", "copper-cable", 6) util.set_ingredient("repair-pack", "iron-gear-wheel", 3) - util.add_unlock_force("electronics", "electronic-circuit") - util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" }) util.add_effect("electronics", { type = "unlock-recipe", recipe = "long-handed-inserter" }) + util.remove_recipe_effect("electronics", "copper-cable") + util.remove_recipe_effect("electronics", "lab") + util.remove_recipe_effect("electronics", "small-electric-pole") util.remove_recipe_effect("automation", "long-handed-inserter") util.set_enabled("electronic-circuit", false) util.set_enabled("inserter", false) + util.set_enabled("copper-cable", true) + util.set_enabled("lab", true) + util.set_enabled("small-electric-pole", true) + util.remove_prerequisite("automation-science-pack", "electronics") + local electronics = data.raw.technology["electronics"] + electronics.research_trigger = nil + electronics.unit = { + count = 10, + time = 10, + ingredients = {{ "automation-science-pack", 1 }} + } + util.remove_prerequisite("fast-inserter", "automation-science-pack") + util.remove_prerequisite("lamp", "automation-science-pack") + util.remove_prerequisite("logistic-science-pack", "automation-science-pack") + util.add_prerequisite("fast-inserter", "electronics") + util.add_prerequisite("lamp", "electronics") util.add_prerequisite("logistic-science-pack", "electronics") + end if not mods.bzaluminum2 and not mods["bzcarbon2"] then util.replace_ingredients_prior_to("electronics", "electronic-circuit", "copper-cable", 2) diff --git a/bzgas2/prototypes/gas-extractor.lua b/bzgas2/prototypes/gas-extractor.lua index 156b547..cd9c3ae 100644 --- a/bzgas2/prototypes/gas-extractor.lua +++ b/bzgas2/prototypes/gas-extractor.lua @@ -54,7 +54,7 @@ data:extend({ name = "gas-extraction", icon = "__bzgas2__/graphics/technology/gas-processing.png", icon_size = 256, - --prerequisites = ge_prereq, + prerequisites = ge_prereq, effects = { {type = "unlock-recipe", recipe = "gas-extractor"}, }, From c3c414f36a77ab480fb0a5647702f33716bdf654 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 4 Nov 2025 23:34:11 +0100 Subject: [PATCH 05/10] Fix early game technologies with bzfoundry --- bzgas2/prototypes/bakelite.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bzgas2/prototypes/bakelite.lua b/bzgas2/prototypes/bakelite.lua index 83a7a9d..7b7ceed 100644 --- a/bzgas2/prototypes/bakelite.lua +++ b/bzgas2/prototypes/bakelite.lua @@ -1,5 +1,10 @@ local util = require("data-util"); +local prereq = {"basic-chemistry"} +if mods["bzfoundry2"] then + table.insert(prereq, "foundry") +end + data:extend({ { type = "item", @@ -30,7 +35,7 @@ data:extend({ name = "bakelite", icon = "__bzgas2__/graphics/technology/bakelite.png", icon_size = 256, - prerequisites = {"basic-chemistry"}, + prerequisites = prereq, effects = { {type = "unlock-recipe", recipe = "bakelite"}, }, From 1b5895b421d84ab90f717fd9236665ac225e94c4 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 4 Nov 2025 23:55:58 +0100 Subject: [PATCH 06/10] Fix hand craft only recipe name --- bzgas2/compatibility/electronic-circuit.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/bzgas2/compatibility/electronic-circuit.lua b/bzgas2/compatibility/electronic-circuit.lua index 65995f0..1dc0e02 100644 --- a/bzgas2/compatibility/electronic-circuit.lua +++ b/bzgas2/compatibility/electronic-circuit.lua @@ -27,6 +27,7 @@ if util.me.handcraft() then end local hcec = futil.table.deepcopy(data.raw.recipe["electronic-circuit"]) hcec.name = "electronic-circuit-handcraft-only" + hcec.localized_name = { "item-name.electronic-circuit" } data:extend({hcec}) util.set_icons("electronic-circuit-handcraft-only", { From 6c0876d0c8f5b3b50d5efd1d5ba91310242434a9 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 5 Nov 2025 00:22:10 +0100 Subject: [PATCH 07/10] Fix early game technologies with Krastorio --- bzgas2/data-final-fixes.lua | 6 +++--- bzgas2/prototypes/bakelite.lua | 4 +++- bzgas2/prototypes/formaldehyde.lua | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bzgas2/data-final-fixes.lua b/bzgas2/data-final-fixes.lua index b23574f..dfa6292 100644 --- a/bzgas2/data-final-fixes.lua +++ b/bzgas2/data-final-fixes.lua @@ -9,9 +9,9 @@ util.set_product_amount("se-core-fragment-omni", "gas", 24) -- Fix basic chemical plant fuels for K2 if mods.Krastorio2 and -data.raw["assembling-machine"]["basic-chemical-plant"] and -data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and -data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories then + data.raw["assembling-machine"]["basic-chemical-plant"] and + data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and + data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories then table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "kr-vehicle-fuel") end diff --git a/bzgas2/prototypes/bakelite.lua b/bzgas2/prototypes/bakelite.lua index 7b7ceed..4597f08 100644 --- a/bzgas2/prototypes/bakelite.lua +++ b/bzgas2/prototypes/bakelite.lua @@ -1,7 +1,9 @@ local util = require("data-util"); local prereq = {"basic-chemistry"} -if mods["bzfoundry2"] then +if mods["Krastorio2"] then + table.insert(prereq, "steel-processing") +elseif mods["bzfoundry2"] then table.insert(prereq, "foundry") end diff --git a/bzgas2/prototypes/formaldehyde.lua b/bzgas2/prototypes/formaldehyde.lua index 36b0be4..66724e3 100644 --- a/bzgas2/prototypes/formaldehyde.lua +++ b/bzgas2/prototypes/formaldehyde.lua @@ -7,6 +7,11 @@ local util = require("data-util"); -- } -- }) +local prereq = {"gas-extraction"} +if mods["Krastorio2"] then + table.insert(prereq, "automation-science-pack") +end + data:extend({ { type = "fluid", @@ -40,7 +45,7 @@ data:extend({ name = "basic-chemistry", icon = "__bzgas2__/graphics/technology/formaldehyde.png", icon_size = 256, - prerequisites = {"gas-extraction"}, + prerequisites = prereq, effects = { {type = "unlock-recipe", recipe = "basic-chemical-plant"}, {type = "unlock-recipe", recipe = "formaldehyde"}, From 46e9a0ce4edaac57d73dedcf9eef77d7f2a31dc9 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 5 Nov 2025 09:44:29 +0100 Subject: [PATCH 08/10] Fix early game technologies with AAI Industry --- bzgas2/compatibility/electronic-circuit.lua | 2 +- bzgas2/data-final-fixes.lua | 4 ++++ bzgas2/prototypes/bakelite.lua | 2 ++ bzgas2/prototypes/gas-extractor.lua | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bzgas2/compatibility/electronic-circuit.lua b/bzgas2/compatibility/electronic-circuit.lua index 1dc0e02..74a3440 100644 --- a/bzgas2/compatibility/electronic-circuit.lua +++ b/bzgas2/compatibility/electronic-circuit.lua @@ -18,7 +18,7 @@ util.add_ingredient("electronic-circuit", "bakelite", amt) util.set_icons("electronic-circuit", nil) -if util.me.handcraft() then +if util.me.handcraft() and not mods["aai-industry"] then data:extend({{ type = "recipe-category", name = "handcraft-only" }}) for i, character in pairs(data.raw.character) do if character and character.crafting_categories then diff --git a/bzgas2/data-final-fixes.lua b/bzgas2/data-final-fixes.lua index dfa6292..e39b171 100644 --- a/bzgas2/data-final-fixes.lua +++ b/bzgas2/data-final-fixes.lua @@ -15,6 +15,10 @@ if mods.Krastorio2 and table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "kr-vehicle-fuel") end +if mods["aai-industry"] and not mods["Krastorio2"] then + util.remove_prerequisite("basic-chemistry", "basic-fluid-handling") +end + -- Vanilla burner phase tweaks -- green circuits after electronics -- Electronic circuit recipe set below in compatibility script if not mods.Krastorio2 and not mods["aai-industry"] and not mods.bzaluminum2 and not mods["bzcarbon2"] then diff --git a/bzgas2/prototypes/bakelite.lua b/bzgas2/prototypes/bakelite.lua index 4597f08..e4815d1 100644 --- a/bzgas2/prototypes/bakelite.lua +++ b/bzgas2/prototypes/bakelite.lua @@ -5,6 +5,8 @@ if mods["Krastorio2"] then table.insert(prereq, "steel-processing") elseif mods["bzfoundry2"] then table.insert(prereq, "foundry") +elseif mods["aai-industry"] then + table.insert(prereq, "automation") end data:extend({ diff --git a/bzgas2/prototypes/gas-extractor.lua b/bzgas2/prototypes/gas-extractor.lua index cd9c3ae..e7f3508 100644 --- a/bzgas2/prototypes/gas-extractor.lua +++ b/bzgas2/prototypes/gas-extractor.lua @@ -13,7 +13,7 @@ if mods.Krastorio2 then ge_prereq = {"kr-stone-processing"} elseif mods["aai-industry"] then table.insert(ge_ingredients, {type="item", name="sand", amount=10}) - ge_prereq = {"sand-processing"} + ge_prereq = {"sand-processing", "basic-fluid-handling"} elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then table.insert(ge_ingredients, {type="item", name="silica", amount=20}) ge_prereq = {"silica-processing"} From 8044c9d846003a8e4be142465135509fa33ab543 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 5 Nov 2025 10:12:25 +0100 Subject: [PATCH 09/10] 2.0.3 --- bzgas2/changelog.txt | 5 +++++ bzgas2/info.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bzgas2/changelog.txt b/bzgas2/changelog.txt index 42c0650..b303e3c 100644 --- a/bzgas2/changelog.txt +++ b/bzgas2/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.3 +Date: 05.11.2025 + Bug Fixes: + - Fix early game progression +--------------------------------------------------------------------------------------------------- Version: 2.0.2 Date: 22.10.2025 Bug Fixes: diff --git a/bzgas2/info.json b/bzgas2/info.json index ebae08f..bdcec07 100644 --- a/bzgas2/info.json +++ b/bzgas2/info.json @@ -1,6 +1,6 @@ { "name": "bzgas2", - "version": "2.0.2", + "version": "2.0.3", "factorio_version": "2.0", "title": "Natural Gas", "description": "Adds a natural gas resource, along with early game plastic.", From 4590fa6b98e17db49caaa5178dfe962dd7081972 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 5 Nov 2025 17:24:27 +0100 Subject: [PATCH 10/10] Fix hand craft only recipe name --- bzgas2/compatibility/electronic-circuit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bzgas2/compatibility/electronic-circuit.lua b/bzgas2/compatibility/electronic-circuit.lua index 74a3440..e1f9aef 100644 --- a/bzgas2/compatibility/electronic-circuit.lua +++ b/bzgas2/compatibility/electronic-circuit.lua @@ -27,7 +27,7 @@ if util.me.handcraft() and not mods["aai-industry"] then end local hcec = futil.table.deepcopy(data.raw.recipe["electronic-circuit"]) hcec.name = "electronic-circuit-handcraft-only" - hcec.localized_name = { "item-name.electronic-circuit" } + hcec.localised_name = { "item-name.electronic-circuit" } data:extend({hcec}) util.set_icons("electronic-circuit-handcraft-only", {