From 0e98d24361cdc75bfac4d8ff2fed0ec34f5825d4 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sun, 2 Nov 2025 10:15:08 +0100 Subject: [PATCH 1/5] Fix booleans being strings --- bztungsten2/data-util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bztungsten2/data-util.lua b/bztungsten2/data-util.lua index bc84044..ff8bd2f 100644 --- a/bztungsten2/data-util.lua +++ b/bztungsten2/data-util.lua @@ -1193,8 +1193,8 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier) 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 + 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 :| From 75d607652d63420cbf260413ef165720de275700 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sun, 2 Nov 2025 10:15:59 +0100 Subject: [PATCH 2/5] Change optics to lamp Factorio 2.0 renamed the technology https://discord.com/channels/1174743568590590053/1429279779634417684/1429332239350632520 --- bztungsten2/data-final-fixes.lua | 4 ++-- bztungsten2/tungsten-recipe-updates.lua | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bztungsten2/data-final-fixes.lua b/bztungsten2/data-final-fixes.lua index 1f7142f..731fc80 100644 --- a/bztungsten2/data-final-fixes.lua +++ b/bztungsten2/data-final-fixes.lua @@ -36,7 +36,7 @@ end -- SE + K2: Keep radar at red science level -util.remove_prerequisite("kr-radar", "optics") +util.remove_prerequisite("kr-radar", "lamp") util.add_prerequisite("kr-radar", "electricity") @@ -48,7 +48,7 @@ util.add_ingredient("omt-electric-mining-drill", "tungsten-carbide", 10) -- Junk Trains, no optics: -util.remove_prerequisite("automated-scrap-rail-transportation", "optics") +util.remove_prerequisite("automated-scrap-rail-transportation", "lamp") util.remove_ingredient("train-stop-scrap", "small-lamp") util.remove_ingredient("rail-signal-scrap", "small-lamp") util.remove_ingredient("rail-chain-signal-scrap", "small-lamp") diff --git a/bztungsten2/tungsten-recipe-updates.lua b/bztungsten2/tungsten-recipe-updates.lua index 1a240d7..c7781a3 100644 --- a/bztungsten2/tungsten-recipe-updates.lua +++ b/bztungsten2/tungsten-recipe-updates.lua @@ -4,12 +4,12 @@ local cuw = "tungsten-plate" if util.me.cuw() then cuw = "cuw" end -- Lamps -util.add_prerequisite("optics", util.me.tungsten_processing) -util.set_tech_recipe("optics", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) +util.add_prerequisite("lamp", util.me.tungsten_processing) +util.set_tech_recipe("lamp", {{"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.add_ingredient("small-lamp", "tungsten-plate", 1) -- Rail signals use lamps -util.add_prerequisite("rail-signals", "optics") +util.add_prerequisite("rail-signals", "lamp") util.add_ingredient("rail-signal", "small-lamp", 1) util.add_ingredient("rail-chain-signal", "small-lamp", 1) @@ -104,14 +104,14 @@ util.add_ingredient("deadlock-floor-lamp", "tungsten-plate", 2) if mods["Krastorio2"] then util.set_tech_recipe("engine", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.set_tech_recipe("fluid-handling", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) - util.set_tech_recipe("optics", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) + util.set_tech_recipe("lamp", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) -- TODO: Fix --util.set_tech_recipe("oil-processing", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) util.set_tech_recipe("plastics", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) if util.me.get_setting("bztungsten-avoid-military") == "yes" then util.set_tech_recipe("rocketry", {{"kr-basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}) end - util.remove_prerequisite("kr-sentinel", "optics") + util.remove_prerequisite("kr-sentinel", "lamp") util.add_prerequisite(util.me.tungsten_processing, "kr-mineral-water-gathering") @@ -453,7 +453,7 @@ util.add_ingredient("simply-power-armor-mk3", "tungsten-plate", 20) -- Cargo Ships -util.add_prerequisite("water_transport_signals", "optics") +util.add_prerequisite("water_transport_signals", "lamp") util.add_ingredient("buoy", "small-lamp", 1) util.add_ingredient("chain_buoy", "small-lamp", 1) util.add_ingredient("oil_rig", "tungsten-carbide", 5) From 720fba8be753df406dd6ddd507988c91844a8905 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sun, 2 Nov 2025 18:04:21 +0100 Subject: [PATCH 3/5] Remove pumpjack technology --- bztungsten2/tungsten-recipe.lua | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/bztungsten2/tungsten-recipe.lua b/bztungsten2/tungsten-recipe.lua index 9d38537..4097004 100644 --- a/bztungsten2/tungsten-recipe.lua +++ b/bztungsten2/tungsten-recipe.lua @@ -101,37 +101,6 @@ data:extend({ } or nil, }) -if mods["aai-industry"] and not data.raw.technology["pumpjack"] then -data:extend({ - { - type = "technology", - name = "pumpjack", - icons = { - { icon = data.raw.technology["oil-processing"].icon, icon_size=data.raw.technology["oil-processing"].icon_size }, - }, - effects = - { - { - type = "unlock-recipe", - recipe = "pumpjack", - }, - }, - unit = - { - count = 25, - ingredients = - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1} - }, - time = 30, - }, - prerequisites = {"fluid-handling"}, - order = "b-b", - }, -}) -end - data:extend({ { type = "recipe", From 46bcd93aeaba89040728ac6c5cf7798ba89ca16f Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sun, 2 Nov 2025 18:52:32 +0100 Subject: [PATCH 4/5] 2.0.2 --- bztungsten2/changelog.txt | 6 ++++++ bztungsten2/info.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bztungsten2/changelog.txt b/bztungsten2/changelog.txt index 4d308d3..a7ad895 100644 --- a/bztungsten2/changelog.txt +++ b/bztungsten2/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.2 +Date: 02.11.2025 + Bug Fixes: + - Change "optics" to "lamp" to respect the Factorio 2.0 renaming + - Remove duplicate pumpjack technology +--------------------------------------------------------------------------------------------------- Version: 2.0.1 Date: 21.10.2025 Changes: diff --git a/bztungsten2/info.json b/bztungsten2/info.json index d4b5b65..2a1cd33 100644 --- a/bztungsten2/info.json +++ b/bztungsten2/info.json @@ -1,6 +1,6 @@ { "name": "bztungsten2", - "version": "2.0.1", + "version": "2.0.2", "factorio_version": "2.0", "title": "Tungsten", "description": "Adds tungsten ore (wolframite), tungsten plates, tungsten carbide and rocket engine nozzles to the base game.", From f0061c6a7f8d599b0d14499ab346f6a8e0f9d99e Mon Sep 17 00:00:00 2001 From: pla Date: Mon, 3 Nov 2025 22:15:49 +0100 Subject: [PATCH 5/5] Fix K2 matter recipe generation and tech icon (#1) I found that while cleaning. ![image](/attachments/2f42cfd0-6093-448f-8eb4-82095d0108fb) Co-authored-by: pla Reviewed-on: https://git.cacklingfiend.info/cacklingfiend/bztungsten2/pulls/1 Co-authored-by: pla Co-committed-by: pla --- bztungsten2/data-util.lua | 90 ++++++++++++++++----------------- bztungsten2/tungsten-matter.lua | 32 ++++++++---- 2 files changed, 66 insertions(+), 56 deletions(-) diff --git a/bztungsten2/data-util.lua b/bztungsten2/data-util.lua index ff8bd2f..b4a1738 100644 --- a/bztungsten2/data-util.lua +++ b/bztungsten2/data-util.lua @@ -109,65 +109,65 @@ function util.se_landfill(params) end end - --- k2 matter +-- k2 matter -- params: {k2matter}, k2baseicon , {icon} function util.k2matter(params) local matter = require("__Krastorio2__/prototypes/libraries/matter") - if mods["space-exploration"] then - params.k2matter.need_stabilizer = true + if mods["space-exploration"] then + params.k2matter.needs_stabilizer = true end if not params.k2matter.minimum_conversion_quantity then params.k2matter.minimum_conversion_quantity = 10 end - if not data.raw.technology[params.k2matter.unlocked_by_technology] then + if not data.raw.technology[params.k2matter.unlocked_by] then local icon = "" if params.k2baseicon then - icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png" + icon = util.k2assets() .. "/technologies/matter-" .. params.k2baseicon .. ".png" else - icon = util.k2assets().."/technologies/backgrounds/matter.png" + icon = util.k2assets() .. "/technologies/backgrounds/matter.png" end - - data:extend( - { + + data:extend({ + { + type = "technology", + name = params.k2matter.unlocked_by, + icons = { { - type = "technology", - name = params.k2matter.unlocked_by_technology, - icons = - { - { - icon = icon, - icon_size = 256, - }, - params.icon, - }, - prerequisites = {"kr-matter-processing"}, - unit = - { - count = 350, - ingredients = mods["space-exploration"] and - { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"se-astronomic-science-pack-4", 1}, - {"se-energy-science-pack-4", 1}, - {"se-material-science-pack-4", 1}, - {"se-deep-space-science-pack-2", 1}, - {"se-kr-matter-science-pack-2", 1}, - } or - { - {"production-science-pack", 1}, - {"utility-science-pack", 1}, - {"kr-matter-tech-card", 1} - }, - time = 45, - }, - localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, + icon = icon, + icon_size = 256, }, - }) + params.icon, + }, + prerequisites = { "kr-matter-processing" }, + unit = { + count = 350, + ingredients = mods["space-exploration"] and { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "se-astronomic-science-pack-4", 1 }, + { "se-energy-science-pack-4", 1 }, + { "se-material-science-pack-4", 1 }, + { "se-deep-space-science-pack-2", 1 }, + { "se-kr-matter-science-pack-2", 1 }, + } or { + { "production-science-pack", 1 }, + { "utility-science-pack", 1 }, + { "kr-matter-tech-card", 1 }, + }, + time = 45, + }, + effects = {}, + -- localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, + }, + }) end - matter.make_recipes(params.k2matter) + if params.k2matter.only_deconversion then + matter.make_deconversion_recipe(params.k2matter) + else + matter.make_recipes(params.k2matter) + end + end diff --git a/bztungsten2/tungsten-matter.lua b/bztungsten2/tungsten-matter.lua index 01c5974..d38b879 100644 --- a/bztungsten2/tungsten-matter.lua +++ b/bztungsten2/tungsten-matter.lua @@ -1,22 +1,32 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then - local util = require("data-util"); - local matter = require("__Krastorio2__/prototypes/libraries/matter") + local util = require("data-util") - matter.make_recipes({ - material = { type = "item", name = "tungsten-ore", amount = 1 }, + util.k2matter({ + k2matter = { + material = { type = "item", name = "tungsten-ore", amount = 30 }, + item_name = "tungsten-ore", matter_count = 6, energy_required = 1, - need_stabilizer = false, - unlocked_by_technology = "tungsten-matter-processing", - icon = {icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", icon_size = 64, scale = 1.25} + needs_stabilizer = false, + unlocked_by = "tungsten-matter-processing", + }, + icon = { + icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", + icon_size = 64, + scale = 1 + }, }) - matter.make_recipes({ - material = { type = "item", name = "tungsten-plate", amount = 1 }, + util.k2matter({ + k2matter = { + material = { type = "item", name = "tungsten-plate", amount = 10 }, + item_name = "tungsten-plate", matter_count = 10, energy_required = 2, - need_stabilizer = false, - unlocked_by_technology = "tungsten-matter-processing", + only_deconversion = true, + needs_stabilizer = true, + unlocked_by = "tungsten-matter-processing", + }, }) end