crafting catagory 0.12.3

Place to get help with not working mods / modding interface.
Post Reply
matjojo
Filter Inserter
Filter Inserter
Posts: 336
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

crafting catagory 0.12.3

Post by matjojo »

hey,

I am looking into creating a new crafting category for my mod, it currently adds 140 recipes and will eventually add more than 300, but looking into the main game code i can't for the life of me figure out how to create a new category. anyone suggestions?

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: crafting catagory 0.12.3

Post by johanwanderer »

Look under data/base/prototypes/categories/recipe-categories.lua

Code: Select all

grep -r category *
...
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
categories/recipe-category.lua:    type = "recipe-category",
...

matjojo
Filter Inserter
Filter Inserter
Posts: 336
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: crafting catagory 0.12.3

Post by matjojo »

johanwanderer wrote:Look under data/base/prototypes/categories/recipe-categories.lua

Code: Select all

grep -r category *
...
categories/recipe-category.lua:    type = "recipe-category",
-snip-
What do you mean by grep -r category * at the start?

so, is it possible to make my own catagory then?, if so, how?

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: crafting catagory 0.12.3

Post by ratchetfreak »

matjojo wrote:
johanwanderer wrote:Look under data/base/prototypes/categories/recipe-categories.lua

Code: Select all

grep -r category *
...
categories/recipe-category.lua:    type = "recipe-category",
-snip-
What do you mean by grep -r category * at the start?

so, is it possible to make my own catagory then?, if so, how?
it's a linux command line utility to search text files

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: crafting catagory 0.12.3

Post by johanwanderer »

matjojo wrote:
What do you mean by grep -r category * at the start?

so, is it possible to make my own catagory then?, if so, how?
"grep" was just a command I used to find anything with the word category in it under the base data. It's pretty handy, and it's available for pretty much every platforms, including Windows.

As far as creating your own category, just look at the file I mentioned. It looks like all it does is adding to the data table using the type "recipe-category". Just follow its lead and see what happens.

Other mods have created their own categories, so it's definitely possible.

Post Reply

Return to “Modding help”