Jump to content

Custom item's recipe image is missing


Recommended Posts

In my character mod, the character grows feathers on their head over time, shaving them yields 'shed feathers' that can be used to make other items. I've gotten the crafting recipe to work, and the feathers themselves are visible both inside the inventory and dropped on the floor. 

However, in the recipe used to make said items, the image of the feathers is missing. I can hover over it and see the name of the item, but it is invisible only in that recipe and nowhere else?

I put the recipe script in the character's prefab file:

Quote

    local wakes_spear_recipe = Recipe("wakes_spear", { Ingredient("twigs", 2),  Ingredient("rope",1), Ingredient("flint",1), Ingredient("wakes_feather",3) }, RECIPETABS.WAR, {SCIENCE=1})
    wakes_spear_recipe.atlas = "images/inventoryimages/wakes_spear.xml"

 

20190609023210_1.jpg

Link to comment
Share on other sites

The problem is that the ingredient "function" (I don't know what else to call it) actually only calls on don't starve items from my experience so you'll have to declare those feathers like so:

local wakes_feather= Ingredient( "wakes_feather", 3)
wakes_feather.atlas = "images/inventoryimages/wakes_feather.xml"

local wakes_spear_recipe = Recipe("wakes_spear", { Ingredient("twigs", 2),  Ingredient("rope",1), Ingredient("flint",1), wakes_feather }, RECIPETABS.WAR, {SCIENCE=1})
 wakes_spear_recipe.atlas = "images/inventoryimages/wakes_spear.xml"

otherwise I can't quite remember if I also ran into the problem of using multiple items in one ingredient so here's an example of what I did (in-case if you run into the problem) when my items called for multiple items:

local rune = Ingredient( "rune", 1 )
rune.atlas = "images/inventoryimages/rune.xml"
local runetwo = Ingredient( "rune", 2 )
runetwo.atlas = "images/inventoryimages/rune.xml"
local runethree = Ingredient( "rune", 3 )
runethree.atlas = "images/inventoryimages/rune.xml"
local runefour = Ingredient( "rune", 4 )
runefour.atlas = "images/inventoryimages/rune.xml"
local runefive = Ingredient( "rune", 5 )
runefive.atlas = "images/inventoryimages/rune.xml"

its kind of sloppy but it gets the job done.

Link to comment
Share on other sites

You can do this as a one-liner

local wakes_spear_recipe = Recipe("wakes_spear", { Ingredient("twigs", 2),  Ingredient("rope",1), Ingredient("flint",1), Ingredient("wakes_feather",3,"images/inventoryimages/wakes_spear.xml") }, RECIPETABS.WAR, {SCIENCE=1})

 

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