WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   Anyone figured out how to tell if a mount can fly? (https://www.wowinterface.com/forums/showthread.php?t=49504)

Gello 07-20-14 05:53 AM

Anyone figured out how to tell if a mount can fly?
 
From p3lim's awesome compilation of new stuff (Thank you very much for posting all that!):
http://www.wowinterface.com/forums/s...ad.php?t=49499

We have a C_MountJournal:
Code:

C_MountJournal.Dismiss
C_MountJournal.GetCollectedFilterSetting
C_MountJournal.GetIsFavorite
C_MountJournal.GetMountInfo
C_MountJournal.GetMountInfoExtra
C_MountJournal.GetNumMounts
C_MountJournal.Pickup
C_MountJournal.SetCollectedFilterSetting
C_MountJournal.SetIsFavorite
C_MountJournal.Summon

GetCompanionInfo("mount",index) is returning nil for all mounts from 1 to GetNumCompanions("mount"), so addons that depend on this will need to use C_MountJournal.

My issue is I can't figure out how to determine whether a mount can fly or not. In GetCompanionInfo we had a bitfield as the 6th return.

These are the returns from C_MountJournal.GetMountInfo:
Code:

local creatureName, spellID, icon, active, isUsable, sourceType, isFavorite, isFactionSpecific, faction, hideOnChar, isCollected = MountJournal_GetMountInfo(i)
C_MountInfo.GetMountInfoExtra appears to be no help either:
Code:

local creatureDisplayID, descriptionText, sourceText, isSelfMount = MountJournal_GetMountInfoExtra(index)
TL;DR: Did we lose the ability to tell if a mount can fly?

edit: btw, it's not related but pretty exciting to me: unlike the C_PetJournal functions that run off an index that changes depending on filter settings, C_MountJournal functions appear to reliably return results with static indexes. If a user has some mounts turned off via filters, looping over the 1,C_MountJournal.GetNumMounts() indexes will still get the unlisted mounts. I would kill to have the pet journal behave this way too.

Duugu 07-20-14 08:26 AM

OT:

Does C_MountJournal.GetMountInfo report correct mount names?

The current GetMountInfo returns "Black Riding Drake" for http://en.wowhead.com/spell=59650 (should be "Black Drake").

Gello 07-20-14 09:36 AM

On the beta C_MountJournal.GetMountInfo for that mount returns "Black Drake" with spellID 59650.

Duugu 07-20-14 09:43 AM

Yay, :)
ty

morpheusxeno 07-20-14 12:29 PM

Usually when it has wings?



LOL... Sorry I had to...

semlar 07-20-14 12:38 PM

Can you filter it by flyability? I don't know what's under the filter options.

Seerah 07-20-14 01:03 PM

Previously, you would check the bit flags to see this info. So, it's not present anymore? This had been added after people (including me) asking for it. :/

Gello 07-21-14 06:33 AM

Yeah it appears the bitfield is gone.

And unfortunately there's no flyability filter. That would be an awesome addition for users. Whether a mount can fly or not is usually a major choice in grouping sets of mounts.

Here's all the filters:


Tooltip scanning is an odorous last resort option. It's slow as death on crutches and requires localization. I need to do some testing on live where we can tell if a mount can fly, but all flying mounts' tooltips seem to end in this string:

"This is a flying mount."
The capabilities of this mount depend "on your Riding skill and location."
This mount changes depending "on your Riding skill and location."

(Land mounts that change depending on riding skill don't mention location; they end with "on your Riding skill.")

From scaning tooltips (TextLeft3 and 4 for the above two strings) it only hits 156 out of 455 mounts that can fly. That number seems low so could be other strings too.

Probably if we don't get a return to tell if a mount can fly, our addons can use a huge table of all spellIDs that can fly. It wouldn't require localization or client-halting tooltip scans, but the table would need updated every time they add a new mount.

But yeah, getting the bitfield back or even a true/false whether a mount can fly would be awesome.

MuffinManKen 07-21-14 04:52 PM

Quote:

Originally Posted by Gello (Post 294147)
Probably if we don't get a return to tell if a mount can fly, our addons can use a huge table of all spellIDs that can fly. It wouldn't require localization or client-halting tooltip scans, but the table would need updated every time they add a new mount.

LibPeriodicTable should have this information. Not as good as API access, but it's there.

Seerah 07-21-14 09:43 PM

Getting the bitfield back would be preferable, as it also returned information such as aquatic, can jump, can mount in water, etc.

Gello 07-22-14 08:18 AM

For anyone else updating addons that need to know if mounts can fly while we wait/pray that we get the bitfield back, this is a table of spellIDs whose tooltip contains a line that ends with "This is a flying mount." or "on your Riding skill and location.". I'm not certain it's all flying mounts.

{ [44744]=1, [136164]=1, [65439]=1, [139448]=1, [132117]=1, [41517]=1, [127164]=1, [75973]=1, [132118]=1, [101282]=1, [61997]=1, [37015]=1, [142478]=1, [132119]=1, [127165]=1, [60021]=1, [32246]=1, [124408]=1, [67336]=1, [59567]=1, [32290]=1, [41518]=1, [155741]=1, [88741]=1, [96503]=1, [107516]=1, [88742]=1, [148476]=1, [59568]=1, [110051]=1, [107517]=1, [49193]=1, [39798]=1, [97493]=1, [32235]=1, [32239]=1, [32243]=1, [134359]=1, [88744]=1, [142073]=1, [59569]=1, [75596]=1, [72807]=1, [32295]=1, [127154]=1, [127170]=1, [142266]=1, [133023]=1, [59976]=1, [43927]=1, [71342]=1, [132036]=1, [88746]=1, [93623]=1, [59570]=1, [153489]=1, [75614]=1, [41513]=1, [127156]=1, [59650]=1, [61451]=1, [39800]=1, [59961]=1, [46199]=1, [107203]=1, [135418]=1, [32240]=1, [60025]=1, [148392]=1, [142878]=1, [139595]=1, [32292]=1, [41514]=1, [127158]=1, [58615]=1, [107842]=1, [46197]=1, [71810]=1, [54729]=1, [163025]=1, [61229]=1, [98727]=1, [163024]=1, [88335]=1, [72286]=1, [88331]=1, [60002]=1, [48025]=1, [121820]=1, [60024]=1, [61309]=1, [88718]=1, [148618]=1, [107844]=1, [59571]=1, [130092]=1, [40192]=1, [44151]=1, [64927]=1, [148620]=1, [32297]=1, [32296]=1, [41515]=1, [130985]=1, [134573]=1, [66087]=1, [32242]=1, [113199]=1, [88990]=1, [32244]=1, [126507]=1, [39802]=1, [149801]=1, [44153]=1, [63796]=1, [139442]=1, [129918]=1, [118737]=1, [113120]=1, [127161]=1, [61294]=1, [32245]=1, [124659]=1, [107845]=1, [93326]=1, [129552]=1, [126508]=1, [66088]=1, [97560]=1, [101821]=1, [123992]=1, [139407]=1, [32289]=1, [102514]=1, [63956]=1, [63963]=1, [123993]=1, [97359]=1, [63844]=1, [110039]=1, [41516]=1, [136505]=1, [127169]=1, [39803]=1, [61996]=1, [148619]=1, [124550]=1, [39801]=1, [136163]=1, [59996]=1, [69395]=1, [61230]=1, [136400]=1, [135416]=1, [72808]=1, [74856]=1, }

This table takes up roughly 14k.

If you're less concerned about speed and want a more compact list table:

{ 44744, 136164, 65439, 139448, 132117, 41517, 127164, 75973, 132118, 101282, 61997, 37015, 142478, 132119, 127165, 60021, 32246, 124408, 67336, 59567, 32290, 41518, 155741, 88741, 96503, 107516, 88742, 148476, 59568, 110051, 107517, 49193, 39798, 97493, 32235, 32239, 32243, 134359, 88744, 142073, 59569, 75596, 72807, 32295, 127154, 127170, 142266, 133023, 59976, 43927, 71342, 132036, 88746, 93623, 59570, 153489, 75614, 41513, 127156, 59650, 61451, 39800, 59961, 46199, 107203, 135418, 32240, 60025, 148392, 142878, 139595, 32292, 41514, 127158, 58615, 107842, 46197, 71810, 54729, 163025, 61229, 98727, 163024, 88335, 72286, 88331, 60002, 48025, 121820, 60024, 61309, 88718, 148618, 107844, 59571, 130092, 40192, 44151, 64927, 148620, 32297, 32296, 41515, 130985, 134573, 66087, 32242, 113199, 88990, 32244, 126507, 39802, 149801, 44153, 63796, 139442, 129918, 118737, 113120, 127161, 61294, 32245, 124659, 107845, 93326, 129552, 126508, 66088, 97560, 101821, 123992, 139407, 32289, 102514, 63956, 63963, 123993, 97359, 63844, 110039, 41516, 136505, 127169, 39803, 61996, 148619, 124550, 39801, 136163, 59996, 69395, 61230, 136400, 135416, 72808, 74856, }

This table takes up about 4k.

LibPeriodicTable-3.1-Misc takes up about 115k. It's a neat library, but it'd be way too much for Select which is <100k on a clean install. But I did use it to confirm the number of flying mounts may be about right, so thanks for mentiong it.

MuffinManKen 07-22-14 05:18 PM

Quote:

Originally Posted by Gello (Post 294240)
LibPeriodicTable takes up about 1900k. It's a neat library, but it'd be way too much for Select which is <100k on a clean install. But I did use it to confirm the number of flying mounts may be about right, so thanks for mentiong it.

That doesn't seem right. 1900K just for LibPeriodicTable-3.1-Misc? LibPeriodicTable is intended to be embedded with just the data sets you require so you can reduce the memory usage. Additionally, since it's shared data, any other addons that use it won't add to that footprint while embedding that table will (assuming multiple addons).

Gello 07-22-14 11:44 PM

Oh that was the whole addon, sorry. The usage links on curse were dead, so I just did a LoadAddOn the whole works.

That said, after some digging:

LibPeriodicTable-3.1-Misc by itself untouched appears to take up 115k after a garbage collection.

The data is stored sequentially so it's safe to compare to the 4k table above, meaning it'd take about 28 addons that need to discern flying mounts to make memory usage favor all 28 addons using LibPeriodicTable-3.1-Misc. And each addon that creates a lookup table like the first would need to create its own copy, removing the shared usage benefit of the table. In the usage page on wowace the example code caches the data into a table the calling addon creates. Every addon that uses that code is going to have a separate table of the same data.

But there's a lot to be said for one central place this stuff gets updated, so only one author needs to maintain the table instead of 28.

Still, getting that bitfield back would be very nice.

Torhal 07-24-14 12:20 PM

Apparently this has been fixed in the next build - GetMountInfoExtra returns the "mountTypeID". We will have to figure out what the different typeIDs mean, but at least there are way fewer

:D

Gello 08-07-14 07:55 PM

Thanks Blizzard and everyone that helped get this back.

Poking at the 5th return of C_MountJournal.GetMountInfoExtra, the possible values over 473 mounts on beta seems to be:

269 (100001101) for 2 Water Striders (Azure and Crimson)
254 (11111110) for 1 Subdued Seahorse
248 (11111000) for 163 "typical" flying mounts, including those that change based on level (Tyreal's Charger, Celestial Steed)
247 (11110111) for 1 Red Flying Cloud (flying mount)
242 (11110010) for 1 Swift Spectral Gryphon (the one we fly while dead? 10th return (hideOnChar) of GetMountInfo is true)
241 (11110001) for 4 Qiraji Battle Tanks (Blue, Green, Red and Yellow)
232 (11101000) for 1 Vashj'ir Seahorse
231 (11100111) for 2 Turtles (Riding and Sea)
230 (11100110) for 298 land mounts

It does not appear to be a bitfield (since there's no common bits unique to the fliers), it's just included to save anyone the effort of expanding them out.

Checking for 247 or 248 will be easy enough. Thanks again!


All times are GMT -6. The time now is 06:05 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI