Page 10 of 10

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Sat Feb 06, 2021 5:07 pm
by DRY411S
Having looked at this issue, and the fact that it is an edge/corner case currently only known with the Industrial Revolution 2 mod, which includes its own Recycling/Scrappage functionality, instead of trying to fix this, the next version of my mod will declare that it is incompatible with Industrial Revolution 2.

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Tue Jul 18, 2023 9:27 am
by DRY411S
I have discovered that the Production Scrap 2 mod, and my Recycling Machines Mod are not compatible. When Production Scrap 2 and Recycling Machines mod are both active, even though they appear to be craftable, any attempt to craft a recycling Machine results in an assembler being crafted instead (or machine scrap)!

I'm looking for a fix...

https://github.com/DRY411S/Recycling-Machines/issues/96

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Tue Jul 18, 2023 11:47 pm
by Silari
Looks like in your mod you're copying the original assembling machine recipe, and setting the result to be your recycling machine. However, Production Scrap 2 adds the results property on the assembling machine recipes since they have more than one possible result - the machine or the scrap. You don't alter results, and results overrides whatever is in result.

You need to do something similar as you do for the ingredients - check if results exists, and if it does iterate through it so you can find the mention of assembling-machine-<level>+1 and replace it with your recycling-machine-<level>+1. Below example works but I certainly haven't tested it thoroughly.

Code: Select all

function swopassemblerforrecycler(recipe,level)
--log("Machine level: " .. level .. " : " .. serpent.block(recipe))
if recipe.ingredients  ~= nil then
	for _,rec_ingredient in ipairs(recipe.ingredients) do
		if rec_ingredient[1] == "assembling-machine-"..level then
			rec_ingredient[1] = "recycling-machine-"..level
		end
	end -- each assembling machine's recipe ingredient
    if recipe.results ~= nil then
        for _,rec_result in ipairs(recipe.results) do
            if rec_result.name == "assembling-machine-"..level+1 then
                rec_result.name = "recycling-machine-"..level+1
            end
        end
	else
        recipe.result = "recycling-machine-" .. level+1
    end
end
if recipe.normal ~= nil then
	for _,rec_ingredient in ipairs(recipe.normal.ingredients) do
		if rec_ingredient[1] == "assembling-machine-"..level then
			rec_ingredient[1] = "recycling-machine-"..level
		end
	end -- each assembling machine's normal recipe ingredient
    if recipe.normal.results ~= nil then
        for _,rec_result in ipairs(recipe.normal.results) do
            if rec_result.name == "assembling-machine-"..level+1 then
                rec_result.name = "recycling-machine-"..level+1
            end
        end
	else
        recipe.normal.result = "recycling-machine-" .. level+1
    end
end
if recipe.expensive ~= nil  then
	for _,rec_ingredient in ipairs(recipe.expensive.ingredients) do
		if rec_ingredient.name == "assembling-machine-"..level then
			rec_ingredient.name = "recycling-machine-"..level
		end
	end -- each assembling machine's expensive recipe ingredient
	if recipe.expensive.results ~= nil then
        for _,rec_result in ipairs(recipe.expensive.results) do
            if rec_result.name == "assembling-machine-"..level+1 then
                rec_result.name = "recycling-machine-"..level+1
            end
        end
	else
        recipe.expensive.result = "recycling-machine-"..level+1
    end
end
--log(serpent.block(recipe))
return recipe
end

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Wed Jul 19, 2023 8:41 am
by DRY411S
Yep, my mod assumes that the assembling machine recipe has a single result, whereas Production Scrap amends it to have a results table.

I have similar code in mind, thanks for the prototype! I do want to return results though, in the spirit of the Production Scrap mod, so there's a chance the crafting of a recycling machine will 'fail' and produce scrap instead.

(I may decide to do the same with all the recycling recipes, so there's a chance the recycling fails and 'scraps' the input.)

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Fri Jul 21, 2023 4:19 am
by DRY411S
Production Scrap 2 mod compatability is going to be a lot more difficult than I thought. Recycling Machines mod does not like any recipes that produce more than 1 result. Because it does not know which result to recycle.

Example:

Production Scrap 2 electronic circuit recipe, uses wire and plate to produce 94% electronic circuit, 6% circuit scrap.
Recycling Machine looks at the results of that recipe, and doesn't know whether it should recycle the circuit or the scrap, and decides it will recycle neither.

(Production Scrap 2 has its own recipes for recycling scrap)

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Fri Apr 19, 2024 10:12 am
by Devastatorius
Is this mod still alive?
I don't see updates for more than 3 years.
Well, i get game crashes frequently when friends sending messages to me on Steam chat and macOS. No idea about Windows OSes.
This happens when i enable this mod.

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Fri Apr 19, 2024 10:46 am
by DRY411S
Devastatorius wrote:
Fri Apr 19, 2024 10:12 am
Is this mod still alive?
I don't see updates for more than 3 years.
Well, i get game crashes frequently when friends sending messages to me on Steam chat and macOS. No idea about Windows OSes.
This happens when i enable this mod.
It's not been amended for 3 years because there are no bugs. ;)

Unless you can give me the error message from factorio when the crashes occur, either screenshots, or factorio log entries that 'blame' this mod for the crashes, then there's nothing I can do to investigate.

(As it happens, with base factorio 2.0 when it drops including vanilla recycling machines, I doubt that there will be any more updates to this mod other than bugfixes until factorio 2.0 is released, and then it will be retired.)

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Fri Apr 19, 2024 10:49 am
by Devastatorius
Ok, i'll try do that on evening. And i have enabled verbose logging to try catch errors or something like that. Thanks.

Re: [MOD 1.1.x|1.0.x]Recycling Machines

Posted: Thu May 16, 2024 8:24 pm
by Devastatorius
Hello.
After tested in some ways, we found is it Steam bug. And it happens in some other games too.
This happens when we trigger shift+tab. Even if this ability is disabled in Steam options.
Good news is that, when we stopped adding/removing mods to the Factorio game, crashes gone away.
BTW thanks for your support and have a good day.