Jump to content

Demonic Textures


Arkathorn

Recommended Posts

You mean the image does not show up for the recipe icon or as ingredient?

 

Did you load the asset?

Did you set the atlas (and image if necessary)?

Did you make sure to say the path?

Did you make sure to say the extension?

Did you check your spelling?

Did you read the log?

Link to comment
Share on other sites

The log says nothing relevant.

function AddRecipeTab(str, sort, atlas, icon)	RECIPETABS[str] =	{		["str"] = str,		["sort"] = sort,		["icon_atlas"] = atlas,		["icon"] = icon	}	return RECIPETABS[str]end
local Assets ={    Asset("ATLAS", "images/tab_tabname.xml"),    Asset("IMAGE", "images/tab_tabname.tex"),    Asset("ATLAS", "images/product.xml"),    Asset("IMAGE", "images/product.tex")}
AddRecipeTab("TABNAME", 8, "images/tab_tabname.xml", "tab_tabname.tex")local recipe_product = Recipe("product", {Ingredient("ingredientA", 2, "images/ingredientA.xml"), Ingredient("ingredientB", 4, "images/ingredientB.xml"), Ingredient("ingredientC", 3, "images/ingedientC.xml")}, RECIPETABS.TABNAME, TECH.MAGIC_TWO)recipe_product.atlas = resolvefilepath("images/product.xml")recipe_product.image = "product.tex"

I have not encountered any issues with the ingredient textures, but product and tab icon textures randomly refuse to register. For tabs, this causes there to be no icon, and for products, this causes the icon to be a random icon, presumably the last used by the engine.

 

However, using other files can work fine, including (if I remember right) renamed versions of the same images!

 

EDIT: The forum seems to have trouble displaying the code.

 

EDIT AGAIN: It seems that either the log did actually contain the errors, and I somehow missed them, or it did not, due to some weird glitchery. Regardless, they were simply the obvious "Asset not loaded" error.

Link to comment
Share on other sites

I have finally resolved the issue.

 

 

When I was first learning how to mod Don't Starve, I mistakenly assumed that 'Asset' was a function that loaded assets. I more recently realized it was simply a data class storing the type and file of an asset.

 

My issue was that I register my recipes in a seperate file to 'modmain.lua', and require it. (For neatness's sake)

This meant that my list of assets ('local Assets = { Asset(...), ... }') served no actual function. Relocating the table to 'modmain.lua', and thus the special environment that recognizes the list, has resolved my issue.

 

Link to comment
Share on other sites

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.

×
  • Create New...