[0.15.37]Why does my recipe take the name of the output item

Place to get help with not working mods / modding interface.
Jelmergu
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 04, 2016 8:49 am
Contact:

[0.15.37]Why does my recipe take the name of the output item

Post by Jelmergu »

I have the following recipe

Code: Select all

{
        type = "recipe",
        name = "burner-to-electric-inserter",
        order = "b",
        icon = "__upgrade-machines__/graphics/icons/burner-to-electric-inserter.png",
        subgroup = "upgrade-machines",
        ingredients = {
            { "electronic-circuit", 1 },
            { "burner-inserter", 1 }
        },
        result = "inserter",
        energy_required = 1,
        enabled = true
    },
With the following line in recipe-name.cfg

Code: Select all

burner-to-electric-inserter=Burner to Electric inserter
I would expect the recipe to be called 'Burner to Electric inserter' in the crafting GUI. The actual name that appears is 'Inserter' which is the name of the output item. This is consistent with the other recipes that have a single result. The recipes that result in multiple items do take the name of the recipe-name.cfg whitch shows to me that the config gets used.

The question now is why the recipe takes the name of the output item if there is a different name defined for it.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5412
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Why does my recipe take the name of the output item

Post by Klonan »

Moved to modding help

I think you need to do:

Code: Select all

main_product = ""
In the recipe definition
Jelmergu
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 04, 2016 8:49 am
Contact:

Re: Why does my recipe take the name of the output item

Post by Jelmergu »

Klonan wrote:Moved to modding help

I think you need to do:

Code: Select all

main_product = ""
In the recipe definition
Works like a charm
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Why does my recipe take the name of the output item

Post by darkfrei »

Klonan wrote:Moved to modding help

I think you need to do:

Code: Select all

main_product = ""
In the recipe definition
Why main product definition changes the recipe name?
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5412
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Why does my recipe take the name of the output item

Post by Klonan »

darkfrei wrote:
Klonan wrote:Moved to modding help

I think you need to do:

Code: Select all

main_product = ""
In the recipe definition
Why main product definition changes the recipe name?
By default the recipe is named after it's product, this is to cut down on duplicate locale entries for simple recipes
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Why does my recipe take the name of the output item

Post by bobingabout »

darkfrei wrote:
Klonan wrote:Moved to modding help

I think you need to do:

Code: Select all

main_product = ""
In the recipe definition
Why main product definition changes the recipe name?
When you have a single result recipe, certain factors are assumed automatically. Naming the recipe after the item, rather than the recipe name saves on locale entries, as pointed out by Klonan. It also does some other internal magic.

By specifying that there is no main product, it should function as if it were a multiple result recipe, and assume the name of the recipe instead of the name of the item.

This also works in reverse, where if you specify a main_product on a multiple output recipe, then the recipe will be named via that product instead.

I believe there's a bit more background processing going on than simply specifying the recipe to use the item's locale entry, but it's not that important for this discussion.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”