Help me understand why my recipe names are wrong.

Place to get help with not working mods / modding interface.
Post Reply
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Help me understand why my recipe names are wrong.

Post 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!

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

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

Post 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.

User avatar
fishycat
Filter Inserter
Filter Inserter
Posts: 309
Joined: Thu Apr 09, 2015 7:38 pm
Contact:

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

Post by fishycat »

Looks like you missed [recipe-name] for it in the locales.

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

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

Post 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.

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

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

Post 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.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

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

Post by PFQNiet »

It should be set on the item. The recipe will default to the name of its main product.

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

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

Post by adamwong246 »

Again, making that change causes a crash with ""Equipment with name 'foot-generator' does not exist""

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

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

Post 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

Post Reply

Return to “Modding help”