248k Redux Mod


Port of the 248k mod by PreLeyZero from 1.1 to Factorio 2.0. May have compatibility issues with other mods.

Overhaul
14 days ago
2.0
7.62K
Transportation Logistic network Manufacturing Power

b K2SO compat recycling bug

a day ago

Found that most recipes changes in scripts/krastorio2/overhaul.lua
The recycling recipe is regenerated in data-final-fix in k2so which runs before the overhaul.lua updates them

fix I found was to add the following to the end of scripts/krastorio2/overhaul

if mods["quality"] then
local skip = {
["kr-advanced-loader"] = true,
["kr-imersium-plate"] = true,
["kr-lithium-sulfur-battery"] = true,
["chemical-science-pack"] = true,
["production-science-pack"] = true,
["utility-science-pack"] = true,
["kr-singularity-tech-card"] = true,
}

local recycling = require("__quality__.prototypes.recycling")

local to_regenerate = {}

for _, entry in ipairs(building_table) do
    local recipe_name = entry[1]
    if not skip[recipe_name] then
        table.insert(to_regenerate, recipe_name)
    end
end

for _, entry in ipairs(item_table) do
    local recipe_name = entry[1]
    if not skip[recipe_name] then
        table.insert(to_regenerate, recipe_name)
    end
end

for _, recipe_name in ipairs(to_regenerate) do
    if data.raw.recipe[recipe_name] then
        data.raw.recipe[recipe_name .. "-recycling"] = nil
        recycling.generate_recycling_recipe(data.raw.recipe[recipe_name])
    end
end

end

Checked this in my own world and it appears to be good now. There is probably an easier way to go about this but I am not very good at lua so even this took me a while.

I am skipping certain recipes as they only output themselves at a 25% chance from how k2so has them setup and those recipes would get removed if I didnt. I dont know for sure what is causing this but it appears to be something with how generate_recycling_recipe creates recipes.

2 hours ago
(updated 2 hours ago)

Thanks, I’m going to use your fix because I don't think I can do it any better. Also, as Todd Howard said: 'It just works.'

2 hours ago

I'm going to test it to see if everything works as intended

New response