Eusong Posted May 14, 2017 Share Posted May 14, 2017 (edited) I'm trying to make a custom recipe that uses a custom ingredient. The ingredient shows up fine in the inventory but when I attempt to use the same image for it to show up in the crafting recipe it doesn't. The recipe just shows a blank box. Here's my code local rainbowfeather = GLOBAL.Ingredient( "rainbowfeather", 1) rainbowfeather.atlas = "images/inventoryimages/inventoryfeatherrainbow.xml" local silverfeather = GLOBAL.Ingredient( "silverfeather", 1) silverfeather.atlas = "images/inventoryimages/inventoryfeathersilver.xml" local clbl = AddRecipe("clbl", { rainbowfeather, silverfeather, Ingredient("goldnugget", 2) }, RecipeTabs.MAGIC, Tech.NONE) clbl.atlas = "images/inventoryimages/clbl.xml" Edited May 14, 2017 by Eusong Link to comment Share on other sites More sharing options...
Lumina Posted May 14, 2017 Share Posted May 14, 2017 Does it works if you do this this way ? local myprefab = AddRecipe("myprefab", {Ingredient("yellowgem", 1), Ingredient("twigs", 5), Ingredient("customingredient", 2, "images/inventoryimages/customingredient.xml", "customingredient") }, RECIPETABS.MAGIC, TECH.MAGIC_THREE, nil, nil, nil, nil, nil, "images/inventoryimages/myprefab.xml", "myprefab.tex" ) Link to comment Share on other sites More sharing options...
DarkXero Posted May 14, 2017 Share Posted May 14, 2017 Do local rainbowfeather = GLOBAL.Ingredient("rainbowfeather", 1) rainbowfeather.atlas = GLOBAL.resolvefilepath("images/inventoryimages/inventoryfeatherrainbow.xml") or local rainbowfeather = GLOBAL.Ingredient("rainbowfeather", 1, "images/inventoryimages/inventoryfeatherrainbow.xml") or local rf_atlas = "images/inventoryimages/inventoryfeatherrainbow.xml" local rainbowfeather = GLOBAL.Ingredient("rainbowfeather", 1, rf_atlas) Whatever is most visually pleasing. But the resolvefilepath function has to go somewhere. The Ingredient class constructor applies it to its atlas argument. Same for the recipe. Link to comment Share on other sites More sharing options...
Eusong Posted May 14, 2017 Author Share Posted May 14, 2017 I attempted your guys' fixes but none of them worked. The image is still invisible in the recipe. Link to comment Share on other sites More sharing options...
DarkXero Posted May 14, 2017 Share Posted May 14, 2017 @Eusong, did you remember to add the assets to the assets table in modmain? Link to comment Share on other sites More sharing options...
Eusong Posted May 14, 2017 Author Share Posted May 14, 2017 2 minutes ago, DarkXero said: @Eusong, did you remember to add the assets to the assets table in modmain? Yes Link to comment Share on other sites More sharing options...
DarkXero Posted May 14, 2017 Share Posted May 14, 2017 @Eusong, is the tex element for rainbowfeather (inside inventoryfeatherrainbow.xml) called rainbowfeather.tex? Not the texture filename, the element. Link to comment Share on other sites More sharing options...
Eusong Posted May 14, 2017 Author Share Posted May 14, 2017 12 minutes ago, DarkXero said: @Eusong, is the tex element for rainbowfeather (inside inventoryfeatherrainbow.xml) called rainbowfeather.tex? Not the texture filename, the element. That fixed it! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now