Page 1 of 1

[2.0.6] defaulting behaviour of localised recipe names when recipe prototype name does not match exactly

Posted: Sat Oct 19, 2024 11:04 am
by grandseiken
The documentation for `main_product` says
For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. Setting the main_product to an empty string ("") forces the title in the recipe tooltip to use the recipe's name (not that of the product) and shows the products in the tooltip.
However on 2.0.6, the `main_product` and/or singular result only causes the icon and subgroup of a recipe to be defaulted, unless the recipe prototype name is identical to the item prototype name of the main product. As well as not matching the documentation this seems like a bad change, since I don't know why you would ever want to default the icon and subgroup but not the localised name. Can it be reverted to the old behaviour?

Code: Select all

data:extend({
  {
    type = "recipe",
    name = "foo-iron-chest",  // works if name = "iron-chest"
    ingredients = {{type = "item", name = "iron-plate", amount = 10}},
    results = {{type = "item", name = "iron-chest", amount = 1}},
    main_product = "iron-chest",
    energy_required = 1,
  }
})

Re: [2.0.6] revert defaulting behaviour of localised recipe names when recipe prototype name does not match exactly

Posted: Sat Oct 19, 2024 1:22 pm
by grandseiken
I have been told this relates to encouraging better recipe names, or possibly to simplify the factoriopedia recipe/item-merging logic.
However, am I wrong, or isn't this the first time the game has made behavioural changes based on the byte contents of prototype names rather than treating them as arbitrary internal identifiers? (and there might be good reasons for mods to use a different naming scheme.)
It feels very surprising to me, I'm not sure why this isn't new behaviour isn't controlled by a bool in the recipe prototype instead.

edit: After actually looking at factoriopedia, I think my request is this: can we please have a bool in the recipe prototype where true indicates that a recipe should be merged in factoriopedia with its main product, and default its name to the item's name, even if the prototype names do not match exactly, false indicates it should not be merged, and nil is the current behaviour?

Re: [2.0.6] defaulting behaviour of localised recipe names when recipe prototype name does not match exactly

Posted: Tue Nov 05, 2024 6:41 am
by Adamo
I came here searching about a similar problem. Is this correct? Because this implies that only one recipe can have an item as its main_product. I found that the main_product is not acting as expected for a series of recipes that share the same main_product and I'm trying to figure out why.