nan1a5 Posted May 17, 2023 Share Posted May 17, 2023 I have prefab and i found it will be disapear when put it on the shelf,i tried to fix it ,but i cant Link to comment Share on other sites More sharing options...
nan1a5 Posted May 17, 2023 Author Share Posted May 17, 2023 i spent all day and only found maybe the problem is in the 'DLC003/scripts/prefabs/shelf.lua' line114 but idk how to fix it, local function SetImage(inst, ent, slot) local src = ent local image = nil if ent.shelfart then image = ent.shelfart..".tex" elseif src ~= nil and src.components.inventoryitem ~= nil then image = ent.components.inventoryitem:GetImage() end if image ~= nil then inst.AnimState:OverrideSymbol(slot, GetInventoryItemAtlas(image), image) --maybe here? --inst.AnimState:OverrideSymbol("SWAP_SIGN", "store_items", image) inst.imagename = src ~=nil or "" else inst.imagename = "" inst.AnimState:ClearOverrideSymbol(slot) end end Link to comment Share on other sites More sharing options...
KXWl1 Posted May 18, 2023 Share Posted May 18, 2023 env.RegisterInventoryItemAtlas = function(atlas, prefabname) --[[ Associate an atlas with a prefab, so the atlas will be used in the inventory item image. The texture within the atlas and the prefab name must be the same for it to work correctly. You will need an ATLAS_BUILD asset loaded if you want your images to appear on mini signs and shelves. E.g.: Asset("ATLAS_BUILD", "images/inventoryimages.xml", 256) Parameters: - atlas (string): the atlas path. E.g.: "images/inventoryimages.xml" - prefabname (string): the texture and prefab name. E.g.: "axe.tex" ]] initprint("RegisterInventoryItemAtlas", atlas, prefabname) RegisterInventoryItemAtlas(resolvefilepath(atlas), prefabname) end Link to comment Share on other sites More sharing options...
nan1a5 Posted May 18, 2023 Author Share Posted May 18, 2023 59 minutes ago, KXWl1 said: env.RegisterInventoryItemAtlas = function(atlas, prefabname) --[[ Associate an atlas with a prefab, so the atlas will be used in the inventory item image. The texture within the atlas and the prefab name must be the same for it to work correctly. You will need an ATLAS_BUILD asset loaded if you want your images to appear on mini signs and shelves. E.g.: Asset("ATLAS_BUILD", "images/inventoryimages.xml", 256) Parameters: - atlas (string): the atlas path. E.g.: "images/inventoryimages.xml" - prefabname (string): the texture and prefab name. E.g.: "axe.tex" ]] initprint("RegisterInventoryItemAtlas", atlas, prefabname) RegisterInventoryItemAtlas(resolvefilepath(atlas), prefabname) end i knew the function but idk how to use it.But after ur explain, it works, thank you so much Link to comment Share on other sites More sharing options...
Recommended Posts
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.