diff --git a/.gitignore b/.gitignore index 723ef36..85e49ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +*.zip \ No newline at end of file diff --git a/Chromium2/changelog.txt b/Chromium2/changelog.txt index 54c5d30..306383c 100644 --- a/Chromium2/changelog.txt +++ b/Chromium2/changelog.txt @@ -1,4 +1,14 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.2 +Date: 11.10.2025 + Bug Fixes: + - Increase mod compatibility +--------------------------------------------------------------------------------------------------- +Version: 2.0.1 +Date: 11.10.2025 + Bug Fixes: + - Increase mod compatibility +--------------------------------------------------------------------------------------------------- Version: 2.0.0 Date: 10.10.2025 Features: diff --git a/Chromium2/data-util.lua b/Chromium2/data-util.lua index debafa9..81def01 100644 --- a/Chromium2/data-util.lua +++ b/Chromium2/data-util.lua @@ -56,16 +56,16 @@ function util.se_matter(params) energy_required = params.energy_required, enabled = false, ingredients = { - {sedata, 1}, + {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, catalyst_amount=25}, + {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}, } } }) @@ -100,9 +100,9 @@ function util.se_matter(params) {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, catalyst_amount=50}, + {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}, } } }) @@ -129,7 +129,7 @@ function util.se_matter(params) {"se-astronomic-science-pack-4", 1}, {"se-energy-science-pack-4", 1}, {"se-material-science-pack-4", 1}, - {"matter-tech-card", 1}, + {"kr-matter-tech-card", 1}, {"se-deep-space-science-pack-1", 1}, } }, @@ -309,10 +309,7 @@ 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[1] and (existing[1] == ingredient[1] or existing[1] == ingredient.name)) or - (existing.name and (existing.name == ingredient[1] or existing.name == ingredient.name)) - ) then + if (existing.name and existing.name == ingredient.name) then return end end @@ -330,10 +327,7 @@ 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[1] == ingredient then - existing[2] = quantity - return - elseif existing.name == ingredient then + if existing.name == ingredient then existing.amount = quantity existing.amount_min = nil existing.amount_max = nil @@ -343,22 +337,21 @@ function set_ingredient(recipe, ingredient, quantity) table.insert(recipe.ingredients, {ingredient, quantity}) end end --- Add a given quantity of product to a given recipe. +-- 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 - local is_fluid = data.raw.fluid[product.name] - add_product(data.raw.recipe[recipe_name], product, is_fluid) + add_product(data.raw.recipe[recipe_name], product) end end -function add_product(recipe, product, is_fluid) +function add_product(recipe, product) if recipe ~= nil then if recipe.results == nil then recipe.results = {} end - table.insert(recipe.results, {type = is_fluid and "fluid" or "item", name = product.result, amount = product.result_count and product.result_count or 1}) + table.insert(recipe.results, product) end end @@ -395,7 +388,7 @@ end -- 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, multiply) + replace_ingredient(data.raw.recipe[recipe_name], old, new, amount or 1, multiply) end end @@ -452,23 +445,20 @@ 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[1] == new or existing.name == new then + 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 - if ingredient[1] == old then - ingredient[2] = math.max(1, ingredient[2] - old_amount) end end add_ingredient(recipe, new, new_amount, is_fluid) end end --- set the amount of a product. +-- 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) @@ -912,7 +902,7 @@ function util.add_unlock_force(technology_name, recipe) util.add_unlock(technology_name, recipe) end --- sum the products of a recipe +-- 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 diff --git a/Chromium2/info.json b/Chromium2/info.json index e08a10b..52cbc76 100644 --- a/Chromium2/info.json +++ b/Chromium2/info.json @@ -1,6 +1,6 @@ { "name": "Chromium2", - "version": "2.0.0", + "version": "2.0.2", "factorio_version": "2.0", "title": "Chromium", "author": "Timeken, cackling fiend", @@ -16,12 +16,12 @@ "? bzgas", "? bzsilicon", "? IfNickel-Updated", - "? Indium", + "? Indium2", "? Krastorio2", "? RampantArsenal", "? space-exploration", - "? Tantalite", + "? Tantalite2", "? ThemTharHills-Updated" ], - "description": "Chromium is a mod adding the element chromium.\n\nThis mod is inspired by Brevven's BZ mods. \n\n Most if not all art is placeholder." + "description": "Chromium is a mod adding the element chromium.\n\nThis mod is inspired by Brevven's BZ mods." } \ No newline at end of file diff --git a/Chromium2/prototypes/chromite-ore.lua b/Chromium2/prototypes/chromite-ore.lua index a30dfcf..49adb16 100644 --- a/Chromium2/prototypes/chromite-ore.lua +++ b/Chromium2/prototypes/chromite-ore.lua @@ -68,6 +68,6 @@ data:extend({ weight = 20*kg, inventory_move_sound = item_sounds.resource_inventory_move, pick_sound = item_sounds.resource_inventory_pickup, - drop_sound = item_sounds.resource_inventory_move, + drop_sound = item_sounds.resource_inventory_move }, }) diff --git a/Chromium2/prototypes/chromium-enriched.lua b/Chromium2/prototypes/chromium-enriched.lua index 1294a18..70eb22b 100644 --- a/Chromium2/prototypes/chromium-enriched.lua +++ b/Chromium2/prototypes/chromium-enriched.lua @@ -36,7 +36,7 @@ data:extend( { {type = "item", name = "enriched-chromium", amount = 6}, {type = "item", name = "iron-ore", amount = 1}, - {type = "fluid", name = "dirty-water", amount = 25, catalyst_amount = 25} + {type = "fluid", name = "kr-dirty-water", amount = 25, catalyst_amount = 25} }, crafting_machine_tint = { @@ -67,12 +67,12 @@ data:extend( { type = "recipe", name = "dirty-water-filtration-chromium", - category = "fluid-filtration", + category = "kr-fluid-filtration", icons = { { - icon = data.raw.fluid["dirty-water"].icon, - icon_size = data.raw.fluid["dirty-water"].icon_size + icon = data.raw.fluid["kr-dirty-water"].icon, + icon_size = data.raw.fluid["kr-dirty-water"].icon_size }, { icon = data.raw.item["chromite-ore"].icon, @@ -81,7 +81,7 @@ data:extend( shift = {0, 4} } }, - icon_size = data.raw.fluid["dirty-water"].icon_size, + icon_size = data.raw.fluid["kr-dirty-water"].icon_size, energy_required = 2, enabled = false, allow_as_intermediate = false, @@ -89,7 +89,7 @@ data:extend( always_show_products = true, ingredients = { - {type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100}, + {type = "fluid", name = "kr-dirty-water", amount = 100, catalyst_amount = 100}, }, results = { diff --git a/Chromium2/prototypes/chromium-matter.lua b/Chromium2/prototypes/chromium-matter.lua index 6414399..24bedc5 100644 --- a/Chromium2/prototypes/chromium-matter.lua +++ b/Chromium2/prototypes/chromium-matter.lua @@ -27,14 +27,14 @@ if mods["Krastorio2"] then { { "production-science-pack", 1 }, { "utility-science-pack", 1 }, - { "matter-tech-card", 1 } + { "kr-matter-tech-card", 1 } }, time = 45 } }, }) - matter.createMatterRecipe({ + matter.make_recipes({ material = { type = "item", name = "chromite-ore", amount = 10 }, matter_count = 5, energy_required = 1, @@ -42,7 +42,7 @@ if mods["Krastorio2"] then unlocked_by_technology = "chromium-matter-processing" }) - matter.createMatterRecipe({ + matter.make_recipes({ material = { type = "item", name = "chromium-plate", amount = 10 }, matter_count = 10, energy_required = 3, diff --git a/Chromium2/prototypes/chromium-recipe-se.lua b/Chromium2/prototypes/chromium-recipe-se.lua index 84fa73e..c586807 100644 --- a/Chromium2/prototypes/chromium-recipe-se.lua +++ b/Chromium2/prototypes/chromium-recipe-se.lua @@ -50,7 +50,7 @@ if mods["space-exploration"] then }, energy_required = 45, ingredients = { - {name = mods["Krastorio2"] and "enriched-chromium" or "chromite-ore", amount = 24}, + {type = "item", name = mods["Krastorio2"] and "enriched-chromium" or "chromite-ore", amount = 24}, {type = "fluid", name = "se-pyroflux", amount = 10}, }, enabled = false, @@ -81,11 +81,11 @@ if mods["space-exploration"] then {icon = "__Chromium2__/graphics/icons/chromium-ingot.png", icon_size = 32, scale = 0.125, shift = {-8, -8}}, }, results = { - {name = "chromium-plate", amount = 10}, + {type="item", name = "chromium-plate", amount = 10}, }, energy_required = 3.75, ingredients = { - {name = "chromium-ingot", amount = 1} + {type="item", name = "chromium-ingot", amount = 1} }, enabled = false, always_show_made_in = true, diff --git a/Chromium2/prototypes/chromium-recipe.lua b/Chromium2/prototypes/chromium-recipe.lua index 4ed7a2d..83620b5 100644 --- a/Chromium2/prototypes/chromium-recipe.lua +++ b/Chromium2/prototypes/chromium-recipe.lua @@ -56,14 +56,14 @@ if mods["Krastorio2"] then { icon = "__Chromium2__/graphics/icons/chromium-plate.png", icon_size = 64}, { icon = "__Chromium2__/graphics/icons/chromite-ore.png", icon_size = 64, scale=0.125, shift= {-8, -8}} }, - category = "electrolysis", + category = "kr-electrolysis", order = "a[chromium-plate]", energy_required = 25, enabled = false, always_show_made_in = true, ingredients = { {type = "fluid", name = "sulfuric-acid", amount = 25}, - {type = "fluid", name = "ammonia", amount = 50}, + {type = "fluid", name = "kr-ammonia", amount = 50}, {type = "item", name = "chromite-ore", amount = 20} }, results = { @@ -214,9 +214,12 @@ data:extend({ } }) -local inconel_ingredients = {{type="item", name="steel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}, mods["Tantalite"] and {type="item", name="niobium-plate", amount=1}} +local inconel_ingredients = {{type="item", name="steel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}} if mods["IfNickel-Updated"] then - inconel_ingredients = {{type="item", name="nickel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}, mods["Tantalite"] and {type="item", name="niobium-plate", amount=1}} + inconel_ingredients = {{type="item", name="nickel-plate", amount=5}, {type="item", name="chromium-plate", amount=3}, {type="item", name="iron-plate", amount=1}} +end +if mods["Tantalite2"] then + table.insert(inconel_ingredients, {type="item", name="niobium-plate", amount=1}) end local inconel_category = "crafting" local inconel_subgroup = "intermediate-product" diff --git a/Chromium2/recipe-modify.lua b/Chromium2/recipe-modify.lua index 36e7407..21a2983 100644 --- a/Chromium2/recipe-modify.lua +++ b/Chromium2/recipe-modify.lua @@ -38,7 +38,7 @@ if mods["space-exploration"] then util.replace_ingredient("se-thruster-suit", "low-density-structure", "chromel-r-fabric") end -if mods["Indium"] then +if mods["Indium2"] then util.replace_ingredient("cryogenic-seal", "steel-plate", "stainless-steel-plate") end