[Solved] Stumped on adding recipe category.

Place to get help with not working mods / modding interface.
Kingdud
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Sat Dec 16, 2017 3:23 am
Contact:

[Solved] Stumped on adding recipe category.

Post by Kingdud »

Code: Select all

table.insert(data.raw["recipe-category"], {name = "bulksmelting", type = "recipe-category"})
I get the error "Prototype name (bulksmelting) does not match the key name (1)".

This makes sense, because I'm actually trying to add an entire key/value pair. I'm not a LUA guy, so it's probably something simple (syntax?) I'm missing. But my efforts to google around for a solution evade me.

"What are you trying to do?" I am creating a mod which will have a giant smelter that is equivalent to 405 normal smelters. It won't be any faster, produce any more outputs, or more efficient, it's just 1 entity instead of 405. Why 405? Because that's how many fit in my factorissimo layout, so I don't have to change a bunch of other stuff. :p To make it work, I am adding two new categories of recipes, bulk smelting and bulk centrifuging. In this way, you have to use the new smelting/centrifuge buildings if you want to use the new recipes. The recipe itself will be slower, but that's because you need ~150 stack inserters to keep up with a building that operates at this scale, so the building itself must be massive to have 150 squares around its perimeter. The recipe time will be scaled so that fully beaconed it will be as close to the same speed as current smelters as possible.

Note: If you were hoping for great new art assets...wrong guy. I make the code do what it's supposed to, but I have the art skills of a dead fish. Recoloring an existing icon is about the limit of my art abilities. Sorry. :(
Last edited by Kingdud on Tue Apr 30, 2019 11:03 pm, edited 1 time in total.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Stumped on adding recipe category.

Post by DaveMcW »

You can't insert into data.raw, you have to use data:extend.

Code: Select all

data:extend{
  {type = "recipe-category", name = "bulksmelting"},
}
Kingdud
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Sat Dec 16, 2017 3:23 am
Contact:

Re: Stumped on adding recipe category.

Post by Kingdud »

Derp. Thanks.
Post Reply

Return to “Modding help”