[0.17.33] main_product mandatory when using results?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

[0.17.33] main_product mandatory when using results?

Post by mrudat »

Is main_product now mandatory if you define the (singular) result of a recipe using results?
What did you do?
To make my code simpler, I normalised the definitions of any recipes I'm about to process, for example:

This is the original recipe:

Code: Select all

data:extend{
  {
    ingredients = {
      {
        "wood",
        2
      }
    },
    name = "wooden-chest",
    result = "wooden-chest",
    type = "recipe"
  }
}
After converting to the more explicit results/ingredients style:

Code: Select all

data:extend{
  {
    ingredients = {
      {
        amount = 2,
        name = "wood",
        type = "item"
      }
    },
--    main_product = "wooden-chest",
    name = "wooden-chest",
    results = {
      {
        amount = 1,
        name = "wooden-chest",
        type = "item"
      }
    },
    type = "recipe"
  }
}
What happened?
Failed to generate prototype because icon not defined, despite icon only being mandatory if there is more than one result, and main_product is not specified.
What did you expect to happen instead?
The documentation for main_product implies that it only needs to be supplied for the case where there is more than one entry in the results table, (and I suspect that the code that parses the recipe definition is happy), but the code that does icon lookup doesn't seem to cope with what should be a transformation that doesn't change the semantics of the recipe definition.

For the moment, I've added a redundant main_product to the transformed recipe data.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.33] main_product mandatory when using results?

Post by Rseding91 »

Thanks for the report hwoever main_product is not mandatory when using results with a singular item. In fact I can paste your recipe definition into the base game and it loads without any problem.

What ever problem you're having is not in the code you've provided.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding help”