Jump to content

Crafting help


Recommended Posts

I never could figure out how to add crafting recipe with custom tab to this game, before or after the update that changed the crafting menu.

I'm trying to add two food items that are crafted under custom tab, that you can craft depending on what tag the character has on currently (sundrops for sunform & moondrops for moonform).

This is from my last try to add the candies:

--------Custom Crafting Tab
--local mytab = AddRecipeTab("Daycare", 998, "images/customs/daycaretab.xml", "daycaretab.tex", "babysitter")

AddRecipe("sundrops",
{ 	Ingredient("berries", 5), 
	Ingredient("papyrus", 2),
	Ingredient("honey", 2)}, 
	RECIPETABS.SURVIVAL,
	TECH.NONE, nil, nil, nil, nil, "sunform")

AddRecipe("moondrops", 
{ 	Ingredient("ice", 2), 
	Ingredient("papyrus", 2),
	Ingredient("blue_cap", 2)}, 
	RECIPETABS.SURVIVAL,
	TECH.NONE, nil, nil, nil, nil, "moonform")

GLOBAL.STRINGS.NAMES.SUNDROPS = "Sundrops"
GLOBAL.STRINGS.RECIPE_DESC.SUNDROPS = "Energizing candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SUNDROPS = "Smells like citrus."

GLOBAL.STRINGS.NAMES.MOONDROPS = "Moondrops"
GLOBAL.STRINGS.RECIPE_DESC.MOONDROPS = "Sleepy-time candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.MOONDROPS = "Smells like berries."

Also side ask about how to set sprites for the items, because I can't find a good tutorial for this.

DA FINISHED.rar

Edited by Enderia
Link to comment
Share on other sites

I don't think it's possible to create a custom crafting tab at the moment without heavily diving into the new UI code. Keeping your character specific recipes in the character tab should be enough though.

As for adding a new recipe, after the UI update AddRecipe has become deprecated. AddRecipe2 should be used now. So if you want to add your recipe you need something like this:

AddRecipe2("sundrops",
	{	Ingredient("berries", 5),
		Ingredient("papyrus", 2),
		Ingredient("honey", 2) },
		TECH.NONE,
	{	atlas = "your_item_atlas",
		image = "your_item_image",
		builder_tag = "sunform" },
	{ "CHARACTER" }
)

AddRecipe2("moondrops",
	{	Ingredient("ice", 2),
		Ingredient("papyrus", 2),
		Ingredient("blue_cap", 2) },
		TECH.NONE,
	{	atlas = "your_item_atlas",
		image = "your_item_image",
		builder_tag = "moonform" },
	{ "CHARACTER" }
)

GLOBAL.STRINGS.NAMES.SUNDROPS = "Sundrops"
GLOBAL.STRINGS.RECIPE_DESC.SUNDROPS = "Energizing candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SUNDROPS = "Smells like citrus."

GLOBAL.STRINGS.NAMES.MOONDROPS = "Moondrops"
GLOBAL.STRINGS.RECIPE_DESC.MOONDROPS = "Sleepy-time candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.MOONDROPS = "Smells like berries."

 

Just make sure to change the "your_item_atlas" and "your_item_image" with your items textures.

Edited by -t-
  • Like 1
Link to comment
Share on other sites

On 4/10/2022 at 9:56 PM, -t- said:

I don't think it's possible to create a custom crafting tab at the moment without heavily diving into the new UI code. Keeping your character specific recipes in the character tab should be enough though.

As for adding a new recipe, after the UI update AddRecipe has become deprecated. AddRecipe2 should be used now. So if you want to add your recipe you need something like this:


AddRecipe2("sundrops",
	{	Ingredient("berries", 5),
		Ingredient("papyrus", 2),
		Ingredient("honey", 2) },
		TECH.NONE,
	{	atlas = "your_item_atlas",
		image = "your_item_image",
		builder_tag = "sunform" },
	{ "CHARACTER" }
)

AddRecipe2("moondrops",
	{	Ingredient("ice", 2),
		Ingredient("papyrus", 2),
		Ingredient("blue_cap", 2) },
		TECH.NONE,
	{	atlas = "your_item_atlas",
		image = "your_item_image",
		builder_tag = "moonform" },
	{ "CHARACTER" }
)

GLOBAL.STRINGS.NAMES.SUNDROPS = "Sundrops"
GLOBAL.STRINGS.RECIPE_DESC.SUNDROPS = "Energizing candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SUNDROPS = "Smells like citrus."

GLOBAL.STRINGS.NAMES.MOONDROPS = "Moondrops"
GLOBAL.STRINGS.RECIPE_DESC.MOONDROPS = "Sleepy-time candy"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.MOONDROPS = "Smells like berries."

 

Just make sure to change the "your_item_atlas" and "your_item_image" with your items textures.

When I tried to use this it the game crashed with "attempt to index global 'TECH' (a nil value)"

Probably im just dumb

DA FINISHED.rar

Edited by Enderia
Link to comment
Share on other sites

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
 Share

×
  • Create New...