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. Fully featured integration with Bobs Mods, Industrial Revolution, and Fantario (independently, not simultaneously)

Content
16 hours ago
0.13 - 2.0
62.6K
Manufacturing

b [Fixed x2] Possible Recipe Bug

5 years ago

Hey, are you aware that when you turn off the ingredient safety toggle it changes at least some recipes to not exceed the stack size? E.G. when this setting is OFF, nuclear reactors only cost one stack each of its ingredients, not the 500 red circuits and so on.

5 years ago

Wait what? As in, the base recipe itself is modified? That's... definitely not intended. I'll take a look at this later; thanks!

5 years ago
(updated 5 years ago)

Looks like it, yes. Cool, thanks! The thing that makes me suspicious that it might be some weird interaction is that it reduces the ingredients down to a single stack of each ingredient for any ingredient that goes over a stack. It wasn't just the nuclear reactor or other things you listed, either: I first noticed on a custom recipe I had from one of my mod's, which asked for 4 stacks of blue chips, but with your setting on, it was reduced to 1 stack of blue chips.

By the way, we did some testing recently, and my tester told me that furnaces no longer discard items past the single stack limit. So perhaps this setting is no longer necessary! But I'll leave that to you, just reporting what we have.

5 years ago
(updated 5 years ago)

Holy crap, you're right. Whatever they changed fixed the dense recipe issue!

I wasn't actually able to recreate the issue (maybe some unknown mod conflict?) but getting rid of that dense recipe logic should fix the issue regardless. Will upload fix soon.

EDIT: Removed ingredient safety toggle as of v6.0.7, hopefully fixing the issues.

5 years ago

Thanks, Kryzeth. Cheers.

5 years ago
(updated 5 years ago)

Hello, it's me again.

I have base 17.49, RF 6.0.7, Robot Army (omni is irrelevant to this crash), and it now crashes again on recipes that result in unstackable items. It's true that the settings is not needed for results over stack size, but apparently the base game still doesn't recognize unstackable items as stacksize = 1...

Failed to load mods: Error while running setup for recipe prototype "rf-droid-flame" (recipe): Recipe item-product "light-armor" is not stackable but has a max count of 2.

Mods to be disabled:
• reverse-factory
• omnimatter_compression

5 years ago
(updated 5 years ago)

Ahh, I did forget about that little bug. I'l have to re-add some of that logic. Shouldn't take long.

EDIT: Hm. That's odd. I can't seem to recreate this error, even while cutting my modlist down to Reverse Factory 6.0.7, Robot Army 0.4.3, Omnilib 3.0.9, and Omnicompression 3.0.7; all on Factorio base 17.49, with the non-intermediate setting disabled, and recyclable power armors/vehicle setting enabled; loaded into the sandbox scenario, and the flame droid is recyclable as expected.

5 years ago
(updated 5 years ago)

I've personally reverted to 6.0.6 instead. I'll try cleaning up my modlist and isolating what else changes things. I said omni was irrelevant because it also errored without Omnicompression active

5 years ago

Very unusual... this doesn't seem like it should be affected by the load order bug, but maybe it is? Either way, I wasn't able to recreate the error with just Robot Army and Reverse Factory, so I thought Omnicompression might be changing something and added it in just in case. Still no errors on my end.

Are you using any of the big mods, such as bobs, angels, or similar?

5 years ago

I use Bob's, Angel's, Clown's, and Omni matter, science, water, wood

5 years ago
(updated 5 years ago)

Hello, I have the same problem

Failed to load mods: Error while running setup for recipe prototype "rf-droid-flame" (recipe): Recipe item-product "light-armor" is not stackable but has a max count of 2.
Mods to be disabled:
• reverse factory
• angel-industries

I'm using angel and bob, but not Omnimatter, Clown or other big overhauls.
How can I help you to find the issue?

Best regards
Maglay

5 years ago

Hmmm... I have tested with both bobs and angels, minus clown's mods, and still couldn't reproduce the error. This is with Robot Army enabled, right? Any settings changed from the defaults?

5 years ago
(updated 5 years ago)

Could you try adding this line to the end of data-final-fixes.lua (in reverse factory 6.0.7?) and then paste what appears? Should be added near line 70 or so?

error(serpent.block(data.raw.recipe["rf-droid-flame"]))
5 years ago
(updated 5 years ago)

Here you are:

39.675 Mods to disable:Failed to load mods: reverse-factory/data-final-fixes.lua:70: {
allow_decomposition = false,
category = "recycle",
energy_required = 30,
hidden = "true",
icon = "robotarmy/graphics/icons/droid_flame_undep.png",
icon_size = 32,
ingredients = {
{
"droid-flame",
1
}
},
name = "rf-droid-flame",
results = {
{
amount = 5,
name = "steel-plate",
type = "item"
},
{
amount = 25,
name = "electronic-circuit",
type = "item"
},
{
amount = 1,
name = "flamethrower",
type = "item"
},
{
amount = 2,
name = "light-armor",
type = "item"
}
},
subgroup = "rf-multiple-outputs",
type = "recipe"
}
stack traceback:
[C]: in function 'error'
reverse-factory/data-final-fixes.lua:70: in main chunk

Mods to be disabled:
• reverse-factor
53.554 Quitting: user-quit.
53.732 Steam API shutdown.
53.739 Goodbye

5 years ago
(updated 5 years ago)

Happens also after a clean install of this mod, i.e. default settings.

The light armor gets manipulated by the early construction drones of Klonan, without the construction drones it works.

5 years ago
(updated 5 years ago)

Hmm.... that's... this only raises more questions than it answers... I thought the issue might be that the recipe results are defined using the complex {amount = #, name = "", type = ""}, instead of the more simple {"name", amount}, but after Klonan's construction drones mod, it didn't change the recipe at all, so that's not the issue.

I let it run as normal and I was able to get the same error. I then checked the difference between the light armor, like maybe stack_size was undefined before, but it seems the only difference between builds, is that the modified light-armor has a tiny-equipment-grid defined (probably for something used by the construction drones?), but that doesn't seem related to the stack size error at all...

I'll have to research this issue a little further...

EDIT: Wow! It IS related to the equipment grid. Enabling an equipment grid onto the light armor causes the max stack error. And this error would only ever occur when there's a recipe that happens to use an item that happens to have an equipment grid... and light armor just happens to be used by both Robot Army and Construction Drones. It's a very rare circumstance.

I wonder what would be the best way to fix this issue....

5 years ago
(updated 5 years ago)

So there's basically two possible solutions, since the error itself is irreconcilable in this instance (construction drones mod needs light armor with equipment grid, item with equipment grid requires stack size of 1, and item with stack size of 1 as a product can't produce more than 1 result.

Either I prevent the recipes from being recyclable to begin with (flame droids cannot be recycled), or I set the item product count to 1 (loses 1 light armor when recycling flame droids).

And I guess there's a third option of having a setting to toggle both solutions (which is basically what I had before lmao). Either of you have any preference?

EDIT: Decided to go for the simplest approach, and just prevent the recycling of flamebots when both Construction Drones and Robot Army are detected. Should be fixed as of v6.0.8

5 years ago
(updated 5 years ago)

Thanks for your work. Preventing the recycling of flamebots sounds good, I use your mod to get rid of 10k inserters when I forgot to enter a limit in a chest, the flamebots can be simply sent to biters and they're gone :)

5 years ago
(updated 5 years ago)

That sounds fair enough. I guess the "robust solution" would be to scan for items that have equipment grids and disclude them from the recycling recipes? But it sounds like what you did is sufficient. I have never encountered this bug. Thanks, Kryzeth.

5 years ago
(updated 5 years ago)

Yeah, it seems to be a pretty rare coincidence. Items with equipment grids aren't usually used in recipes that require more than 1 of that item. They either aren't used in recipes at all, or they are used in upgrade recipes that would usually only require 1 item anyways.

It's just this one specific interaction between Robot Army adding a recipe using 2 light-armor and Construction Drones giving light-armor an equipment grid for a completely different reason lmao.

EDIT: Also locking this post before anybody else comments on it, because although the solution to the original problem did cause a new problem, that new problem should have been asked on its own post, to avoid unnecessary notification spam to unrelated persons lol.

This thread has been locked.