Reverse Factory

by Kryzeth

Reverse Factory machine will recycle (uncraft) nearly any item placed inside. Supports the recycling of most, if not all, modded items.

Content
14 days ago
0.13 - 2.0
67.6K
Manufacturing

b [Fixed/Implemented] Error when loading with Scrappy Industry

4 months ago

When loaded together with th Scrappy Industry mod, the game shows the following error:

3.660 Error ModManager.cpp:1758: Failed to load mod "reverse-factory": reverse-factory/data-final-fixes.lua:35: attempt to index field 'rf-barrel' (a nil value)
stack traceback:
reverse-factory/data-final-fixes.lua:35: in function 'final_fixes'
reverse-factory/data-final-fixes.lua:58: in main chunk
3.696 Loading mod core 0.0.0 (data.lua)
3.762 Checksum for core: 2220362065
3.804 Error ModManager.cpp:1758: Error in assignID: recipe-category with name 'recycling' does not exist.

I recall playing with the two mods together sometime in the past (a month or two, maybe?) and it used to work fine, but that doesn't seem to be the case anymore (which jeopardizes one of my old saves..).
I tried disabling the "Solid Recycled Fluids" option but that didn't really do anything. Neither did disabling Scrappy Industry's "Handcraft-friendly" option (which "Creates hidden duplicates of recipes to allow seamless handcrafting").

4 months ago

Hmm, while I can technically fix the startup error between the two mods, it won't fix the underlying incompatibility between the two.

I think there might have been a passive load order change, since both mods run during data-final-fixes; their mod modifies almost all of the recipes in the game and adds a percent chance to produce scrap, while my mod ignores all recipes that have percentage (which prevents the rf-barrel recipe from being created, which I modify later)

I can update it to only modify the rf-barrel recipe if it exists in the game, which will prevent the startup error and allow the game to load, but basically nothing is recyclable because all the recipes are now percentage-based instead, and I'm not entirely sure how or if I should handle those.

Implemented the fix as of v9.0.32, but I wouldn't say they are entirely compatible.

4 months ago

I see, thank you. Would it be worth approaching the Scrappy Industry mod about compatibility or is this just fundamentally unsolvable?

4 months ago

It mainly depends on what the solution should be; if the goal is to make the items recycle back into the recipes, regardless of the percentage-type recipes, then technically I could make it work, by just removing the restriction for those kinds of recipes.

The only problem with that solution is that it might not apply globally to all mods that use percentage-type recipes. Maybe.. maybe I could just lift the restriction for this specific mod, that could be a more viable solution (though it pushes the main argument further down the road, but hopefully it just won't come up again with another mod lol)

14 days ago
(updated 14 days ago)

I realized that I didn't even need to add any logic to get the reverse recipes to work with Scrappy Industry, I was only really worried about the balance issues of crafting, recycling, then crafting again, getting additional scrap every time for infinite resources, but I decided to ignore that issue and just make it work, letting players make the choice to abuse the potential exploit if they want.

Barely needed to add any code, since the main_product was defined, allowing the copy recipe function to work without any other changes (simply allowing it to pass through the probability/multiple products check)

So finally, Scrappy Industry is fully compatible as of v9.0.40 (and as an added bonus, I added as many of the single-ingredient scrap/sorting recipes to the Reverse Factory, locked to tier 2 and above, allowing you to keep looping some of the materials without needing another furnace/assembling machine to process them)

14 days ago

Awesome work, thank you.

New response