Page 1 of 1

crafting catagory 0.12.3

Posted: Tue Aug 11, 2015 11:02 am
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?

Re: crafting catagory 0.12.3

Posted: Tue Aug 11, 2015 4:04 pm
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",
...

Re: crafting catagory 0.12.3

Posted: Tue Aug 11, 2015 6:01 pm
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?

Re: crafting catagory 0.12.3

Posted: Tue Aug 11, 2015 7:06 pm
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

Re: crafting catagory 0.12.3

Posted: Wed Aug 12, 2015 2:55 am
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.