[2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Things that we aren't going to implement
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

[2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Post by MasterBuilder »

This is debatable as to it being a bug or not, but it's a very misleading error to me and had me scratching my head for a few minutes about it.

The error in question:

Code: Select all

Error ModManager.cpp:1733: Error while loading recipe prototype "stacked-copper-plate" (recipe): Key "icon" not found in property tree at ROOT.recipe.stacked-steel-plate
Modifications: Deadlock Experimental Stacking
Except the icon is optional if the recipe has one result item, so I couldn't understand why it wasn't working when other recipes did.

Code: Select all

local stacked_cable = {
    type = "recipe",
    name = "stacked-copper-cable",
    normal = {
        enabled = false,
        energy_required = 0.5 * cable_density,
        ingredients = {{"deadlock-stack-copper-plate", 1}},
        results = {{"deadlock-stack-copper-cable",2}},
    },
    expensive = {
        enabled = false,
        energy_required = 0.5 * cable_density,
        ingredients = {{"deadlock-stack-copper-plate", 1}},
        results = {{"deadlock-stack-copper-cable",2}},
    },
}
(This is after I changed result/result_count to results.)
As it turns out, normal/expensive has been removed, so the actual error is that those are defined, and not the missing icon itself. Once I replaced it with just the contents of the normal section, the icon error went away.

So it'd be great if the error was something along the lines of normal/expensive sections being defined, instead of something that seems completely different from a user perspective.
Last edited by MasterBuilder on Tue Oct 22, 2024 9:42 pm, edited 3 times in total.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2964
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Post by boskid »

1/ You are showing error for "stacked-steel-plate" but data for "stacked-copper-cable"
2/ `icon` is required when `icons` are not given.

Not a bug.
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Post by Bilka »

Moved to modding interface requests to maybe adjust the error message.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Post by MasterBuilder »

boskid wrote: Tue Oct 22, 2024 5:59 pm 1/ You are showing error for "stacked-steel-plate" but data for "stacked-copper-cable"
2/ `icon` is required when `icons` are not given.

Not a bug.
Yeah, that was me just copying one of the recipes in the file. The exact name didn't matter since the issue was on the misleading error message of icons and I know that the cause is the normal/expensive groups. (I'll just edit them to match.)
Either way, it was moved to modding interface requests, so, not a bug for that I guess.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.8] Missleading error on recipe proto about missing icon when recipe has normal/expensive defined.

Post by Rseding91 »

Having a custom error for a mod defining "normal" and "expensive" for a recipe seems like overkill. It could just as easily have been they defined all the values in "something_that_is_not_valid" which also wouldn't work. It just happens that "icon"/"icons" is the first value it tried to read from the definition that wasn't defined.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't implement”