Recipe.main_product, is everything right on the wiki?

Anything related to the content on our wiki (https://wiki.factorio.com/)

Moderator: Bilka

Post Reply
User avatar
hhrhhr
Inserter
Inserter
Posts: 34
Joined: Mon Feb 18, 2019 11:02 pm
Contact:

Recipe.main_product, is everything right on the wiki?

Post by hhrhhr »

https://wiki.factorio.com/Prototype/Recipe#main_product wrote:main_product
Type: string
Optional.

For recipes with more than one product: This defines of which result the icon, subgroup and name is used. If it is not set and the recipe has more than 1 result the recipe will use the recipe-name and recipe-description locale and its own subgroup and icon.

For recipes with 1 result: The recipe uses the icon, subgroup and name of the result by default. If set this property is set to an empty string, the recipe will use the properties of the recipe instead of the result.
Recipe "solid-fuel-from-petroleum-gas" for example:

Code: Select all

{
    type = "recipe",
    name = "solid-fuel-from-petroleum-gas",
--
    results = { [1] = {type="item", name="solid-fuel", amount=1} },
    icon = "__base__/graphics/icons/solid-fuel-from-petroleum-gas.png",
    icon_size = 64, icon_mipmaps = 4,
    subgroup = "fluid-recipes",
    enabled = false,
    order = "b[fluid-chemistry]-d[solid-fuel-from-petroleum-gas]",
--
}
There is no main_product defined, so main_product=nil; -- nil ~= "" (empty string). Recipe have only one product, so "The recipe uses the icon, subgroup and name of the result by default" should be used. But in real this recipe used "the properties of the recipe instead of the result".

Whats wrong?

User avatar
hhrhhr
Inserter
Inserter
Posts: 34
Joined: Mon Feb 18, 2019 11:02 pm
Contact:

Re: Recipe.main_product, is everything right on the wiki?

Post by hhrhhr »

Second example:

Code: Select all

{
      type = "recipe",
      name = "sulfuric-acid",
      results = { [1] = { type = "fluid", name = "sulfuric-acid", amount = 50 } },
      subgroup = "fluid-recipes", -- !!! subgroup present
-- cutted
}
Recipe have only one product and no main_product is defined. So icon(s) taken from product, but subgroup taken from recipe...

What is the actual order of definition for the icons, subgroup and localized name?

Post Reply

Return to “Wiki Talk”

Who is online

Users browsing this forum: No registered users