Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

mikey99222

HELP! CUSTOM ITEM NOT WORKING

Recommended Posts

Kzisor    1,058

I see now the issue, working on a fix for it. It seems to be with how you added the recipe. You cannot add the recipe in the prefab of the file. It needs to be added in the modmain.lua file.

 

Here is the code which make it work.

 

modmain.lua

Assets = {
Asset("IMAGE", "images/inventoryimages/wand.tex"),
Asset("ATLAS", "images/inventoryimages/wand.xml" ),
}
 
local wand = Recipe("wand", {Ingredient("twigs", 1)}, GLOBAL.RECIPETABS.WAR,  GLOBAL.TECH.NONE)

wand.atlas = "images/inventoryimages/wand.xml"

 

Remove these two assets from your wand.lua and remove the recipe from wand.lua as well. It will work. Now you should be able to alter the wand.tex and wand.xml to your desires.

Share this post


Link to post
Share on other sites
mikey99222    6

I see now the issue, working on a fix for it. It seems to be with how you added the recipe. You cannot add the recipe in the prefab of the file. It needs to be added in the modmain.lua file.

 

Here is the code which make it work.

 

modmain.lua

Assets = {
Asset("IMAGE", "images/inventoryimages/wand.tex"),
Asset("ATLAS", "images/inventoryimages/wand.xml" ),
}
 
local wand = Recipe("wand", {Ingredient("twigs", 1)}, GLOBAL.RECIPETABS.WAR,  GLOBAL.TECH.NONE)

wand.atlas = "images/inventoryimages/wand.xml"

 

Remove these two assets from your wand.lua and remove the recipe from wand.lua as well. It will work. Now you should be able to alter the wand.tex and wand.xml to your desires.

 

 

thank you sooooo much, it works, (it is invisible when held but hey!)

 

*i think i can fix this, i will add ALL assets from wand.lua to the modmain.lua*

Share this post


Link to post
Share on other sites