xlsean Posted January 3, 2023 Share Posted January 3, 2023 I am a new modder and only know a few APIs. In DST mods, I found most resovled atlases can be tested by TheSim:AtlasContains but some images from other mods (not all mods, just some) cannot pass. I appreciate if anyone can explain the difference. I checked code of 'GetInventoryItemAtlas' but TheSim:AtlasContains seems in the engine code function FoodItem:DefineAssetData() self.item_tex = self.prefab..'.tex' self.atlas = GetInventoryItemAtlas(self.item_tex) self.localized_name = STRINGS.NAMES[string.upper(self.prefab)] or self.prefab if not self.atlas or not TheSim:AtlasContains(self.atlas, self.item_tex) then print("Craft pot ~ AssetData: failed to resolve[" .. self.prefab .. "]" .. self.localized_name .. " tex:" .. (self.item_tex or "nil") .. " atlas:" .. (self.atlas or "nil")) end end The followings are logs of above code. [00:39:10]: WARNING! Invalid resource handle for atlas 'FROMNUM', did you remember to load the asset? [00:39:10]: Craft pot ~ AssetData: failed to resolve[myth_food_nx]XXXXX tex:myth_food_nx.tex atlas:images/inventoryimages/myth_food_nx.xml [00:39:10]: WARNING! Invalid resource handle for atlas 'FROMNUM', did you remember to load the asset? [00:39:10]: Craft pot ~ AssetData: failed to resolve[myth_food_hlbz]XXXX tex:myth_food_hlbz.tex atlas:images/inventoryimages/myth_food_hlbz.xml Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/ Share on other sites More sharing options...
Rickzzs Posted January 4, 2023 Share Posted January 4, 2023 You didn't load these two atlases? Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616671 Share on other sites More sharing options...
xlsean Posted January 4, 2023 Author Share Posted January 4, 2023 @Rickzzs How can I load them since they are in other mods not mine? BTW, besides the warnings, images still show in my mod correctly. Do I have to Asset(...) the images in other mods though they must have been loaded by the owner mod? Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616690 Share on other sites More sharing options...
Rickzzs Posted January 5, 2023 Share Posted January 5, 2023 If the other mod has already loaded these assets, then there couldn't have been warnings. I think the atlas you get are wrong, they are relative paths, so the game fails to find them. Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616762 Share on other sites More sharing options...
xlsean Posted January 5, 2023 Author Share Posted January 5, 2023 @Rickzzs Besides the warnings above, the image of the atlas displayed correctly. I guess it could be a timing issue, since GetInventoryItemAtlas and TheSim:AtlasContains are called in modmain. However, my focus is GetInventoryItemAtlas can give me correct results but the results are failed to be tested by TheSim:AtlasContains. Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616770 Share on other sites More sharing options...
Rickzzs Posted January 5, 2023 Share Posted January 5, 2023 I don't think GetInventoryItemAtlas returns correct result based on your description, that's all. Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616793 Share on other sites More sharing options...
xlsean Posted January 5, 2023 Author Share Posted January 5, 2023 4 hours ago, xlsean said: Besides the warnings above, the image of the atlas displayed correctly No, I meant the image resolved by GetInventoryItemAtlas can be displayed correctly in my widgets Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1616796 Share on other sites More sharing options...
xlsean Posted January 9, 2023 Author Share Posted January 9, 2023 This is still not resolved Link to comment https://forums.kleientertainment.com/forums/topic/145440-the-atlas-resolved-by-getinventoryitematlas-cannot-be-tested-by-thesimatlascontains/#findComment-1617069 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