originally posted in:BungieNetPlatform
View Entire Topic
Can anyone point me in the right direction on how to replicate the XP percentage bar that shows in game for unmaxed weapons/armor? The progress properties of an inventory item don't seem to provide the right data.
English
#Destiny
-
I'll attempt to answer my own question here. I can get a pretty decent percentage value by going through the talentNodes of an item and and doing talentNodes.length * 100 to get the total percentage value of all nodes and then adding up the actual percentage values for each node. I do not have access to my console right now to verify how closely these progress bars match, but it seems to be pretty close. Some pseudo js code: // Get full item // ENDPOINT: /Destiny/[membershipType]/Account/[accountId]/Character/[characterId]/Inventory/[itemInstanceId]/ var talentNodes = result.data.talentNodes; var actualPercentageAmount = 0; for (var i=0; i<talentNodes.length; i++) { var node = talentNodes[i]; actualPercentageAmount += node.progressPercent; } return actualPercentageAmount / (talentNodes.length * 100);