Shigeo Kageyama Posted July 2, 2022 Share Posted July 2, 2022 (edited) Please help me!It's my first time making a mod. I don't want to set the inventory image separately for each prefab. And I want minisign worked. So I imitate Island Adventure mod. I almost made it. I packed all my tex files into one file. And I imported it as forum do Assets = { Asset("ATLAS", "images/ws_inventoryimages.xml"), Asset("IMAGE", "images/ws_inventoryimages.tex"), Asset("ATLAS_BUILD", "images/ws_inventoryimages.xml", 256) } Here's part of my code: local UpvalueHacker = require('utils/upvaluehacker') GLOBAL.require("simutil") local GetInventoryItemAtlas_old = GLOBAL.GetInventoryItemAtlas local inventoryItemAtlasLookup = UpvalueHacker.GetUpvalue( GLOBAL.GetInventoryItemAtlas, "inventoryItemAtlasLookup") local ws_inventoryimages = GLOBAL.resolvefilepath( "images/ws_inventoryimages.xml") GLOBAL.GetInventoryItemAtlas = function(imagename) if inventoryItemAtlasLookup[imagename] then return inventoryItemAtlasLookup[imagename] end if GLOBAL.TheSim:AtlasContains(ws_inventoryimages, imagename) then inventoryItemAtlasLookup[imagename] = ws_inventoryimages return ws_inventoryimages end return GetInventoryItemAtlas_old(imagename) end But inventory image don't appear when I enter the game. My item's inventory image just become a black square. After I draw my item on minisign. It worked! Not being a black square again. I don't know why. Apparently it related to this line: inst.AnimState:OverrideSymbol("SWAP_SIGN", atlas or GetInventoryItemAtlas(image .. ".tex"), image .. ".tex") But I can't find definition of AnimState:OverrideSymbol I don't know why it can make inventory image work again. What can I do to fix this? This tormented me a lot. I would appreciate it if someone could help me! Thanks Edited July 2, 2022 by Shigeo Kageyama Link to comment https://forums.kleientertainment.com/forums/topic/141404-need-help-about-inventory-image/ Share on other sites More sharing options...
Shigeo Kageyama Posted July 4, 2022 Author Share Posted July 4, 2022 Thanks for Jerry002's help. I resolved it. It's because wrong file format I used Simple TEX Atlas Packer 0.2.0.2 in the past. It has some problem with size. Inventory image size must be 64*64. The packer sometimes generate 64*65. Link to comment https://forums.kleientertainment.com/forums/topic/141404-need-help-about-inventory-image/#findComment-1581839 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