[0.16.51] Loss of Armor MK1 inventory when crafting MK2

Bugs that are actually features.
Naium
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Jul 06, 2018 11:43 pm
Contact:

[0.16.51] Loss of Armor MK1 inventory when crafting MK2

Post by Naium »

I unequipped my Power Armor MK1 (so its in the Inventory now), with the Grid full of roboports and fusionreactors etc. Then I crafted an MK2 Power armor. Then I realized that the Grid was still full of stuff, so I aborted the crafting to take everything out.

Then the Grid of the returned MK1 Armor was empty.

Id expect all the contents of the MK1 Armor to either drop into my inventory, or to still be there. But the content was just deleted.

I tried to reproduce it, and I got the same result. So it happens every time. I didn't try what happens when you do not unequip the Armor.
Attachments
DieNichtSoBeltlessFactoryWithPlayer.zip
The save-file.
(27.17 MiB) Downloaded 79 times
factorio-current.log
The log-file.
(22.35 KiB) Downloaded 77 times
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: [0.16.51] Loss of Armor MK1 inventory when crafting MK2

Post by TruePikachu »

I believe this is technically Not A Bug, since the code is AFAIK working as intended (destroying the ingredient objects when something is queued for crafting). However, this situation also can't arise in the vanilla game, as no items with an equipment grid (AFAIK only being the three armors) are used as an ingredient for crafting (Power Armor Mk2 is EM3*5 + SM3*5 + ProcessingUnit*40 + Steel*40 + 25s).
Rseding91
Factorio Staff
Factorio Staff
Posts: 14344
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Loss of Armor MK1 inventory when crafting MK2

Post by Rseding91 »

TruePikachu wrote:I believe this is technically Not A Bug, since the code is AFAIK working as intended (destroying the ingredient objects when something is queued for crafting). However, this situation also can't arise in the vanilla game, as no items with an equipment grid (AFAIK only being the three armors) are used as an ingredient for crafting (Power Armor Mk2 is EM3*5 + SM3*5 + ProcessingUnit*40 + Steel*40 + 25s).
Correct. The crafting system was never built to handle this kind of logic and we aren't looking at extended it to handle it. For now: don't make mods that do that.
If you want to get ahold of me I'm almost always on Discord.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.51] Loss of Armor MK1 inventory when crafting MK2

Post by eradicator »

Rseding91 wrote:Correct. The crafting system was never built to handle this kind of logic and we aren't looking at extended it to handle it. For now: don't make mods that do that.
How difficult/expensive would it be to have a "can't use this as ingredient in hand crafting if the grid isn't empty"-flag? (assuming i'm right about that the main performance problem would be assemblers having to check that...) Mods that do incremental upgrades for armor are quite common (i.e. Mk. N requires MK. N-1). And it would still be a problem even if the player had one Mk.N-1 with empty grid and one with full grid, because one doesn't know which one will be used automatically when crafting a Mk.N.

TL;DR: No fancy refunds, just block it from being used in crafting?

[thinkythinky....hm. I guess one could make a mod that substracts 1 HP from the armor when a player inserts an equipment into it? That would make it damaged and thus unusable in crafting.]
Rseding91
Factorio Staff
Factorio Staff
Posts: 14344
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Loss of Armor MK1 inventory when crafting MK2

Post by Rseding91 »

The problem comes with recipe calculations (can you craft it) not knowing anything about the source items. Additionally it gets more complicated when you could have 2 armors one with items and one without and now the "remove items from inventory" logic has to have special cases built into it different from script "remove" that only recipes would use.

Then comes making that logic only apply to hand crafting and telling the player *why* they can't craft the thing in the tooltip somewhere.

It's just way too much complication and code bloat for something that the base game has no interest in supporting.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”