Compare commits

...
Sign in to create a new pull request.

4 commits
main ... main

Author SHA1 Message Date
Simon Brodtmann
99cab50b68 Forgot thanks 2025-11-01 23:00:22 +01:00
Simon Brodtmann
db3137985e 2.0.2 2025-11-01 22:53:22 +01:00
Simon Brodtmann
04a1e986dd Fix booleans being strings 2025-11-01 13:01:42 +01:00
pla
8db4982e5b Fixing K2 matter stuff (#1)
Fixed K2 matter generation
Fixed Matter tech icon size
Sadly the matter conversion recipe icons are not fixed, because the K2 routine doesn't like the 128px icons
Check if Matter recipes already exist, error with Them Thar Hills

![image](/attachments/f1ccec6e-768a-425e-b0dc-1691b8d78037)

Co-authored-by: pla
Reviewed-on: cacklingfiend/bzgold2#1
Co-authored-by: pla <pla@noreply.example.org>
Co-committed-by: pla <pla@noreply.example.org>
2025-11-01 13:01:21 +01:00
6 changed files with 49 additions and 38 deletions

View file

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.0.2
Date: 01.11.2025
Bug Fixes:
- Fix K2 matter integration (thanks pla)
---------------------------------------------------------------------------------------------------
Version: 2.0.1
Date: 21.10.2025
Changes:

View file

@ -115,12 +115,12 @@ end
function util.k2matter(params)
local matter = require("__Krastorio2__/prototypes/libraries/matter")
if mods["space-exploration"] then
params.k2matter.need_stabilizer = true
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"
@ -132,7 +132,7 @@ function util.k2matter(params)
{
{
type = "technology",
name = params.k2matter.unlocked_by_technology,
name = params.k2matter.unlocked_by,
icons =
{
{
@ -163,11 +163,16 @@ function util.k2matter(params)
},
time = 45,
},
localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
effects = {},
-- localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
},
})
end
if params.k2matter.only_deconversion then
matter.make_deconversion_recipe(params.k2matter)
else
matter.make_recipes(params.k2matter)
end
end
@ -1188,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 :|

View file

@ -1,6 +1,6 @@
{
"name": "bzgold2",
"version": "2.0.1",
"version": "2.0.2",
"factorio_version": "2.0",
"title": "Noble Metals",
"description": "Adds silver, gold, platinum, palladium and more to the base game. Reworks processing units.",

View file

@ -1,30 +1,31 @@
-- Matter recipes for Krastorio2
if mods["Krastorio2"] then
local util = require("data-util");
local util = require("data-util")
if not data.raw.recipe["kr-gold-ore-to-matter"] then
util.k2matter({
k2matter = {
material = { type = "item", name = "gold-ore", amount = 30 },
item_name = "gold-ore",
matter_count = 30,
energy_required = 10,
need_stabilizer = false,
unlocked_by_technology = "gold-matter-processing",
needs_stabilizer = false,
unlocked_by = "gold-matter-processing",
},
k2baseicon = "stone",
icon = {icon = "__bzgold2__/graphics/icons/gold-ore.png", icon_size = 128, scale = 1}
icon = { icon = "__bzgold2__/graphics/icons/gold-ore.png", icon_size = 128, scale = 0.5 },
})
end
if settings.startup["bzgold-silver"].value then
util.k2matter({
k2matter = {
material = { type = "item", name = "silver-ore", amount = 8 },
item_name = "silver-ore",
matter_count = 8,
energy_required = 5,
need_stabilizer = false,
unlocked_by_technology = "silver-matter-processing",
needs_stabilizer = false,
unlocked_by = "silver-matter-processing",
},
k2baseicon = "stone",
icon = {icon = "__bzgold2__/graphics/icons/silver-ore.png", icon_size = 128, scale = 1}
icon = { icon = "__bzgold2__/graphics/icons/silver-ore.png", icon_size = 128, scale = 0.5 },
})
end
end

View file

@ -1,4 +1,4 @@
local util = require("data-util");
local util = require("data-util")
if mods.Krastorio2 then
@ -92,7 +92,7 @@ data:extend({
{
icon = data.raw.item["gold-ore"].icon,
icon_size = data.raw.item["gold-ore"].icon_size,
scale = 0.2,
scale = 0.2 * 64 / (data.raw.item["gold-ore"].icon_size or 64),
shift = {0, 4}
}
},

View file

@ -1,4 +1,4 @@
local util = require("data-util");
local util = require("data-util")
if mods.Krastorio2 and util.me.silver() then
data:extend({
@ -111,7 +111,7 @@ data:extend({
{
icon = data.raw.item["silver-ore"].icon,
icon_size = data.raw.item["silver-ore"].icon_size,
scale = 0.2,
scale = 0.2 * 64 / (data.raw.item["silver-ore"].icon_size or 64),
shift = {0, 4}
}
},