[0.17.79] Recipe prototype icon and locale inheritance behaves differently

Things that already exist in the current mod API
Post Reply
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 259
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

[0.17.79] Recipe prototype icon and locale inheritance behaves differently

Post by theRustyKnife »

When a recipe doesn't have icons or locale specified, but has a main product, it uses it's icons/locale. However, when a recipe is defined such that the main product is different for normal and expensive versions, the main product for the recipe overall is ambiguous. Locale just falls back (correctly, in my opinion) to recipe-name.xxx. Icons however are taken from the main product for the normal version, which is somewhat arbitrary.

What makes me think this is a bug, is that if the expensive version doesn't have a main product, you get an error saying icon is not specified, which is just weird.

Here's an example recipe that gets the default locale (recipe-name.test-recipe in this case), but the icon from the normal version (the iron stick icon):

Code: Select all

{
	type = 'recipe',
	name = 'test-recipe',
	enabled = true,
	subgroup = data.raw['item']['constant-combinator'].subgroup,
	
	normal = {
		ingredients = {},
		result = 'iron-stick',
	},
	
	expensive = {
		ingredients = {},
		result = 'iron-plate',
	},
},

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.79] Recipe prototype icon and locale inheritance behaves differently

Post by Klonan »

I will move this to modding interface requests

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

Re: [0.17.79] Recipe prototype icon and locale inheritance behaves differently

Post by Rseding91 »

If you define a recipe with different products where there is no main product for each version of normal and expensive, then the game requires you define what icon to use for the recipe in general.

If every version (normal and expensive) have a main product, the main product icon is used. No part of that defaults to the normal recipes icon.
If you want to get ahold of me I'm almost always on Discord.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.17.79] Recipe prototype icon and locale inheritance behaves differently

Post by Bilka »

To make Rseding's reply a bit more clear: It already works the way you asked for, the expensive recipe shows the iron plate and the normal recipe shows the stick.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Already exists”