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?
			
			
									
									
						crafting catagory 0.12.3
- 
				johanwanderer
 - Fast Inserter

 - Posts: 157
 - Joined: Fri Jun 26, 2015 11:13 pm
 
Re: crafting catagory 0.12.3
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
What do you mean by grep -r category * at the start?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-
so, is it possible to make my own catagory then?, if so, how?
- 
				ratchetfreak
 - Filter Inserter

 - Posts: 952
 - Joined: Sat May 23, 2015 12:10 pm
 - Contact:
 
Re: crafting catagory 0.12.3
it's a linux command line utility to search text filesmatjojo wrote:What do you mean by grep -r category * at the start?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-
so, is it possible to make my own catagory then?, if so, how?
- 
				johanwanderer
 - Fast Inserter

 - Posts: 157
 - Joined: Fri Jun 26, 2015 11:13 pm
 
Re: crafting catagory 0.12.3
"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.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?
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.