Page 1 of 1

Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 5:12 pm
by adamwong246
This is heavily based on the modding tutorial on the wiki.

The problem is described here https://github.com/adamwong246/chernobyl/issues/1 and the code is up to date.

I'm not sure if this is confusion with Factorio or with Lua, because this is my first time using Lua. Sorry if this is a dumb question!

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 5:27 pm
by PFQNiet
Since you have not provided a localised_name for the item, it defaults to its place_result - in this case its placed_as_equipment_result. Since it is placed as an Exoskeleton, that is the name it gets.

You would need to set:

Code: Select all

localised_name = "item-name.foot-generator"
Then your locale file can specify the name for the item, which will override the default behaviour.

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 5:38 pm
by fishycat
Looks like you missed [recipe-name] for it in the locales.

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 5:57 pm
by adamwong246
Should this be set upon the item or the recipe?
PFQNiet wrote:
Wed Jan 27, 2021 5:27 pm
Since you have not provided a localised_name for the item, it defaults to its place_result - in this case its placed_as_equipment_result. Since it is placed as an Exoskeleton, that is the name it gets.

You would need to set:

Code: Select all

localised_name = "item-name.foot-generator"
Then your locale file can specify the name for the item, which will override the default behaviour.

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 6:00 pm
by adamwong246
Making this change causes the game to crash with "Equipment with name 'foot-generator' does not exist"
fishycat wrote:
Wed Jan 27, 2021 5:38 pm
Looks like you missed [recipe-name] for it in the locales.

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 6:05 pm
by PFQNiet
It should be set on the item. The recipe will default to the name of its main product.

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 6:08 pm
by adamwong246
Again, making that change causes a crash with ""Equipment with name 'foot-generator' does not exist""

Re: Help me understand why my recipe names are wrong.

Posted: Wed Jan 27, 2021 6:22 pm
by adamwong246
Ok guys, thanks for the help. I have a half-solution which I can live with for now... I don't want to wrestle with localization right now but I'll fix it later. https://github.com/adamwong246/chernoby ... 5f8f36bf9d