originally posted in:BungieNetPlatform
can't for the life of me find a unique way to separate out item types (class item, helmet, primary, secondary, etc...)
tried with the 'definition' flag on, and still didn't see anything that could help me.
sample diff: https://www.diffchecker.com/gt6lfl6m
closest i could get was with the .itemTypeName prop... but things like the vex mytho (primary fusion rifle) will still slip through the cracks.
am i just blind...? do i just suck it up and use itemTypeName? anyone have any suggestions?
cheers.
-
Ironically, this is a common problem for us as well. Items are a very generic concept in Destiny, and currently our definitions reflect that... genericness. Indeed, Milkazar's suggestion of getting definitions is very good - dig through those and take a peek. The Bucket hash will at least give you a general idea of the type of item. It won't catch some things - for example, an item in your "primary weapon" bucket could be an auto rifle, or it could be an engram. You'll know that it either is or will become a primary weapon, but not much more. itemTypeName on the definition will give you the localized text for what we call the item's type - that's more reliable. We also have a couple of enums that break it down further on the item definition. These enums are specifically built for "BungieNet/Companion" needs, so their groupings might seem not as useful as you'd hope... but if you find them useful, you're free to access them. The "itemType" property is an enum is as such: enum DestinyItemType { None = 0, Currency = 1, Armor = 2, Weapon = 3, Bounty = 4, CompletedBounty = 5, BountyReward = 6, Message = 7, Engram = 8, Consumable = 9, ExchangeMaterial = 10, MissionReward = 11 } "itemSubType" is an enum as such, and breaks down further classifications: enum DestinyItemSubType { None = 0, Crucible = 1, Vanguard = 2, IronBanner = 3, Queen = 4, Exotic = 5, AutoRifle = 6, Shotgun = 7, Machinegun = 8, HandCannon = 9, RocketLauncher = 10, FusionRifle = 11, SniperRifle = 12, PulseRifle = 13, ScoutRifle = 14 } If the item has a class type, the "classType" property will restrict as such: enum DestinyClass { Titan = 0, Hunter = 1, Warlock = 2, Unknown = 3 } There is even a "specialItemType", which is an enum of such. We use them to classify items for Advisors, so as you'll see they're very specialized: SpecialItemType { None = 0, SpecialCurrency = 1, CompletedBounty = 2, CrucibleBounty = 3, VanguardBounty = 4, IronBannerBounty = 5, QueenBounty = 6, ExoticBounty = 7, Armor = 8, Weapon = 9, Engram = 23, Consumable = 24, ExchangeMaterial = 25, MissionReward = 27, BountyReward = 28, Currency = 29 } Hopefully this is of help! One last thing for ?definitions=true users: if you end up making many calls to the service, I *highly* recommend using the mobile databases for this definition information instead of calling definitions=true! It's good for learning, but in the end you'll use up far less bandwidth (yours and ours!) by grabbing and using those databases. There may come a time in the future where we have to/decide to retire the definitions=true querystring parameter due to the unnecessary extra bandwidth it consumes, so you'll be greatly benefited by using the mobile databases instead in the long run!
-
Try using definitions=true plural. Then get the buckethash and read the bucketname.