C_TransmogCollection Missing Source Help
TorelTwiddler is coding an addon that adds a line to item tooltips to tell you if you have learned a transmog appearance (Can I Mog It? - Trying to get it on here...but it's being difficult for some reason).
So far we've found what we need from existing functions, but can't find the one that will tell us if the item is eligible for "You've collected this appearance, but not from this item". This tooltip is available in the game through CVar missingTransmogSourceInItemTooltips and C_TransmogCollection.GetShowMissingSourceInItemTooltips, but there doesn't seem to be a function in C_TransmogCollection that provides this information. Or if there is, we're missing it or how to use it. We have tried almost all of the C_TransmogCollection functions and PlayerKnowsSource in particular but it returns seemingly inconsistent information. PlayerHasTransmog(ItemID) returns whether the player has the transmog from that item only, but doesn't include if it has been learned from a different item, so the result is that the addon thinks the appearance hasn't been learned at all. We're looking for something like: PlayerHasTransmogAppearance(itemID) - returns bool of whether the player has the transmog appearance, regardless if this is the exact item it came from or something like these two example functions (so we can make our own) GetAppearance(itemID) - returns the visualID of the item PlayerHasTransmogByAppearance(visualID) - returns bool of whether the the player has the transmog appearance or instructions for where this data is stored (if it's stored client side). So does what we're looking for exist and we're missing it? Is there an easier way of getting what we need? |
This is probably more complicated than it needs to be.
Lua Code:
|
Quote:
Never mind, it has nothing to do with a DressUpModel... I'll move my question to its own topic |
Quote:
The still broken items seem to be ones with multiple versions of the same name and item number. We're not sure if it's something we're doing wrong or the game is. PlayerHasTransmog = false:
PlayerHasTransmog = true:
Any ideas? |
I went ahead and edited my original post with an updated version that should correctly support items which have the same item ID but different appearances as long as you supply it with the full item link.
It will still work with just item IDs, but will only return information about the base item if you don't give it the link. |
http://www.wowinterface.com/forums/s...ad.php?t=53734
Problem is that most methods in C_TransmogCollection only work for items the current character can equip. :/ |
Quote:
That simplifies things because it also tells you whether you've collected the appearance, I'll update my post to use that instead. One thing I noticed is that this doesn't necessarily return information the first time you call it. It seems to be because the model won't equip the item if it hasn't been cached, so it may be necessary to cache the item and issue a callback when it's available, but that shouldn't be an issue if you're just adding text to the item's tooltip since the tooltip won't populate if the item hasn't been cached yet. |
Quote:
I also just noticed that there's now C_TransmogCollection.SetShowMissingSourceInItemTooltips, enabling this adds TRANSMOGRIFY_TOOLTIP_APPEARANCE_UNKNOWN to all uncollected appearances (even for plate items when I'm on a Demon Hunter) and it also adds TRANSMOGRIFY_TOOLTIP_ITEM_UNKNOWN_APPEARANCE_KNOWN when the appearance is known but we learned it from another item, which is pretty awesome :D Edit: Forgot to mention, DressUpModel.GetSlotTransmogSources doesn't work for tabards (19). |
Quote:
Sounds like we'll still have to iterate over all of the sources for an appearance if we want to check whether we've collected it. |
Hi semlar and sezz,
Thanks for the code snippets! It looks like the main issues we were having with "alternate source" items is resolved now. Our next issue is that there are legendary items, such as the Runestaff of Nordrassil (http://legion.wowhead.com/item=71085...-of-nordrassil) that are supposed to be non-transmoggable, but it's showing as transmoggable but not learned yet. Is that another thing that you may know how to get around? Thanks again! |
Quote:
|
Quote:
1. Some equipable items are not transmoggable by anyone, but I don't know how to determine if it is or not. 2. My current method of determining if an item is transmoggable by anyone or not has localization issues (specifically I use a mapping to the Weapon type name). Unfortunately, PlayerCanCollectSource doesn't work for 1, and is inconsistent for 2. In the addon I am trying to differentiate between something that cannot be learned on this character, and something that cannot be learned at all. C_TransmogCollection.PlayerCanCollectSource seems to (usually) correctly return if the item can be collected by this character, but I would also need to know if it is transmoggable by anyone. For example, the Runestaff of Nordrassil returns false for PlayerCanCollectSource, but I also need to know if it's transmoggable at all (which it is not). I am checking for transmoggablility by checking the item type against a localized mapping of item type (weapons use "Bows", "Guns", etc., armor uses "INVTYPE_LEGS", "INVTYPE_BODY", etc.) to Transmog Category (found using C_TransmogCollection.GetCategoryInfo for the category numbers) and plugging it into C_TransmogCollection.IsCategoryValidForItem. This works very consistently with two problems, 1. localization, 2. doesn't work on some very specific items (Runestaff for example). C_TransmogCollection.PlayerCanCollectSource and C_TransmogCollection.PlayerKnowsSource seem to return inconsistent results. For example, changing the addon logic to use PlayerCanCollectSource (like in your code snippet) breaks tabards (none seem to have a source) and fishing poles (all seem to have a source, but they are not transmoggable), and the brewfest steins (not transmoggable). GitHub link if you'd like to see the code. I also made a branch that integrates your latest function: https://github.com/TorelTwiddler/CanIMogIt I really appreciate your help in figuring out the issues we've been running into. I wish Blizzard put out actual docs for their API! Thanks again! |
Quote:
Localization wouldn't be a problem since you could just check the item against all 28 categories and see if any return true. C_Transmog.GetItemInfo appears to return whether the item is a valid source for transmogrification, and what the error is (eg. "INVALID_SOURCE", "NO_STATS", "INVALID_TYPE") for the third and fourth values. I'm not sure about the first, if it's false then the second return is the error (eg. "NO_ITEM", "NOT_SOULBOUND", "INVALID_TYPE", "INVALID_TARGET"). The item must be cached for this to return valid information. If it's not cached, it returns "false, NO_ITEM". For what it's worth, tabards do not return a source when equipped on a model, so the only way to support them would be to build your own database from C_TransmogCollection.GetCategoryAppearances(6) and C_TransmogCollection.GetAppearanceSources(visualID). |
Got everything working now, thanks for your help! You can check out the addon here: http://www.wowinterface.com/download...o.php?id=24015
|
Did you guys actually get C_Transmog.GetItemInfo working then? I'm getting NO_ITEM for everything on live, including items from my bags, so it's not an issue of caching. The predecessor, GetItemTransmogrifyInfo, was also broken.
|
Quote:
eg. C_Transmog.GetItemInfo(2912) returns true, nil, true If the item isn't cached you may need to call it a second time. |
Right, that's what the issue was with the old function too I guess. Didn't try with item ID for my bag item. Think there might have been some issue with using item ID, because I stopped using it when it no longer worked with links... perhaps random stat items not working because of "no stats" when given only the item ID, but that at least seems to work now.
|
All times are GMT -6. The time now is 03:14 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI