Jump to content

Recommended Posts

I wanted to add a custom recipe by putting this in the modmain:

local Ingredient = GLOBAL.Ingredient
local af_rec = AddRecipe("butterfly", 
{Ingredient("petals", 2)},
GLOBAL.RECIPETABS.SURVIVAL, GLOBAL.TECH.NONE, nil, nil, nil, nil, "animalfood_builder","images/inventoryimages/butterfly_mimi.xml", "butterfly_mimi.tex")
GLOBAL.STRINGS.RECIPE_DESC.BUTTERFLY = "Give life to a butterfly!"
af_rec.sortkey = -1

And it works but the image in the crafting tab changes each time you switch between tabs. I have had this problem before but can't remember how to get it working again/what could've gone wrong.

 

Also, I am using this butterfly image in images/inventoryimages

and these .tex and .xml files

butterfly_mimi.tex

butterfly_mimi.xml

butterfly_mimi.png

GLOBAL.RECIPETABS.SURVIVAL, GLOBAL.TECH.NONE, nil, nil, nil, nil, "animalfood_builder","images/inventoryimages/butterfly_mimi.xml", "butterfly_mimi.tex")

Is it better if you add a space before "images/inventoryimages..." ?

Like this ?

GLOBAL.RECIPETABS.SURVIVAL, GLOBAL.TECH.NONE, nil, nil, nil, nil, "animalfood_builder", "images/inventoryimages/butterfly_mimi.xml", "butterfly_mimi.tex")

Because i don't see anything wrong right now...

Haha that was a good idea. Too bad it wasn't that though. I hate these sorts of issues because the game won't tell you why it is not working properly.

 

Edit: it just hit me. I have to add images/inventoryimages/butterfly_mimi.xml and .tex in the Assets in the modmain. I was confused because it wasn't present for some reaosn with another recipe yet that one worked fine.

Edited by Thibooms

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...