Jump to content

Recommended Posts

How can I add my custom recipe to the game filters other than "modded" filter? I'm trying to revitalize a broken mod (I'm not the author) and I managed to make it work, but can't have it showing in the cooking "tab" (filter).

I'm not a programmer and I'm just learning some LUA, but that's the recipe (new function already) I'm trying to use:

 

AddRecipe2("deluxpot", RecipeIngredients,
	TECH.SCIENCE_TWO,
	{placer="deluxpot_placer", atlas="images/inventoryimages/deluxpot.xml"},
	CRAFTING_FILTERS.COOKING)

Also tried without success:

AddRecipeToFilter("deluxpot", CRAFTING_FILTERS.COOKING)

I have at the start of the mod the usual CRAFTING_FILTERS = GLOBAL.CRAFTING_FILTERS, of course (was crashing before that, so I did it and now I can start the server lol)

Link to comment
https://forums.kleientertainment.com/forums/topic/140273-new-ui-filters/
Share on other sites

It's pretty simple. CRAFTING_FILTERS.COOKING is a table variable, not a string one.

There are no current variables to determine the tab names (that I know of), so:

AddRecipe2("deluxpot", RecipeIngredients, TECH.SCIENCE_TWO, {placer="deluxpot_placer", atlas="images/inventoryimages/deluxpot.xml"}, { "COOKING", "STRUCTURES" })

I think this piece of code should do. This should place the item under the Cooking and Structures tabs, much like a normal Crock Pot.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...