Thread Tools Display Modes
09/12/15, 11:00 AM   #1
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
item link field 5

Any one know what the 5 field of an item link is for? I got loot from two different hireling mails, both with a Rekuta, but the Rekuta item links are different.

links:
Code:
       
"|H0:item:45853:23:50:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|hRekuta|h"
"|H0:item:45853:23:3:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|hRekuta|h"
50 vs 3. How are these items different?


Thanks,
- Lodur
  Reply With Quote
09/12/15, 11:20 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Look here: http://www.uesp.net/wiki/Online:Item_Link

I would guess, the runes are from different zones.
  Reply With Quote
09/12/15, 12:09 PM   #3
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Well that is surprising. So in effect a Rekuta is a Rekuta. And can stack with different Rekuta. But may have different item links even though they are the same...

I was comparing itemlinks to find duplicate items in user mails. That does not seem to be perfect now.
  Reply With Quote
09/12/15, 02:47 PM   #4
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Lodur View Post
I was comparing itemlinks to find duplicate items in user mails. That does not seem to be perfect now.
You can use the code below to compare items to see if they are the same item. But make sure you note they won't necessarily be exactly the same. They could have different enchantments, quality, exc... Which may or may not be what you want.

Use the itemId to see if they are the same:
Lua Code:
  1. local itemId = select(4,ZO_LinkHandler_ParseLink(link))
select(4, ...
Means that it will grab the 4th item/data from the link.

Do note on the page that Votan linked you, even though it shows:
1: Id -- The ID of the base object (1-80000).
That does not mean it should be select(1, ... that would be the text name of the item

For select statements the select number corresponds to:
select(1, ... -- item name as string (obvious its not a link)
select(2, ... -- The first 0 (or 1 after update #6) following the |H used to be the link hex color (RRGGBB) but this was changed (around update 4) to be always 0.
select(3, ...-- The item is always there for item links. It is different for other types of links (character, achievement, etc...).
The item name sometimes ends with a control code ^m which can be removed. No obvious purpose.
There are 21 integer item data fields (20 prior to update 6 in May 2015):

select(4, ... -- 1: Id -- The ID of the base object (1-80000).
select(5, ... -- 2: SubType -- Some combination of the item's quality and VR level (0-317, see below).
exc...
  Reply With Quote
09/12/15, 07:47 PM   #5
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Thanks for the help. I'm going with this to start with, based all your input, to get a string that can be compared. I think this will cover all my cases. Not sure I really want the 5th field or not, but starting testing with it first.

And I need to add provisioning and alchemy types as well still...

I can confirm the issues comes from have hirelings on characters of different levels. The 6th field is always the level of the character that received the hireling mail.


Code:
local function GetItemLinkKey(link)
  local itemType = GetItemLinkItemType(link)

  if (itemType == ITEMTYPE_ENCHANTING_RUNE_ASPECT) or
     (itemType == ITEMTYPE_WEAPON_TRAIT) or
     (itemType == ITEMTYPE_ARMOR_TRAIT) or
     (itemType == ITEMTYPE_WOODWORKING_BOOSTER) or
     (itemType == ITEMTYPE_CLOTHIER_BOOSTER) or
     (itemType == ITEMTYPE_BLACKSMITHING_BOOSTER) then

    local _, _, _, f4, f5 = ZO_LinkHandler_ParseLink(link)

    return 'key:item:' ..  f4 .. ':' ..  f5

   else
     return link
   end
end
  Reply With Quote
09/12/15, 10:03 PM   #6
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Lodur View Post
I was comparing itemlinks to find duplicate items in user mails. That does not seem to be perfect now.
Maybe I misunderstood what you want. I thought you were just trying to compare items to see if they are the same? If so all you need is the code I posted.
Lua Code:
  1. local itemOneLink = GetItemLink(...)
  2. local itemTwoLink = GetItemLink(...)
  3.  
  4. local itemIdItemOne = select(4,ZO_LinkHandler_ParseLink(itemOneLink))
  5. local itemIdItemTwo = select(4,ZO_LinkHandler_ParseLink(itemTwoLink))
  6.  
  7. if itemIdItemOne == itemIdItemTwo then
  8.    -- their the same item
  9.    -- Although possibly different stats
  10. end

I'm not sure what you are trying to do with the GetItemLinkKey() code you posted above. If you can post more details about what you are trying to do I could be of more help.

If your trying to create links, this page has some examples on it (you have to scroll down to the item link section & its at the bottom) http://wiki.esoui.com/ZO_LinkHandler_CreateLink
  Reply With Quote
09/13/15, 09:26 AM   #7
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
I have been using the item link as a table key to detect duplicate items and display the total looted count.



In this image you can see that the Bervez Juice has 3 entries. This is a bug. There where only a total of 20 looted from 3 hireling mails.

So I currently believe I have two bugs in this area. One is with the item links not being comparable. The second seems to be in my list control, as these 3 Bervez Juice had the same link. Both bugs visually appear the as too many rows in the list.

I have the item link different for the same item reproducible in a test now.

The reason for the way I went with my function is Rewards for the Worthy mails drop weapons and armor. Don't these types of items need the extra link fields for sets, traits and enchants?

My goal is a row per item type (items having the same visual ItemTooltip). Since I have ItemTooltips for items in the list window, I don't want similar but not exactly the same items grouped together either. That would hide some of exact detail of what you looted.
  Reply With Quote
09/13/15, 12:01 PM   #8
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Lodur View Post
The reason for the way I went with my function is Rewards for the Worthy mails drop weapons and armor. Don't these types of items need the extra link fields for sets, traits and enchants?

My goal is a row per item type (items having the same visual ItemTooltip). Since I have ItemTooltips for items in the list window, I don't want similar but not exactly the same items grouped together either. That would hide some of exact detail of what you looted.
Yes it needs the extra fields, if you care about that stuff. But if you need them to be exactly the same then you have to compare the entire link or else there is no guarantee that their exactly the same. If you want them to be "mostly" the same, so that the tooltips match, I don't think you can do that with the link "fields" themselves. Even if you tried to pick & choose which fields you needed to compare you would still have to write a lot of extra code because different fields would matter for different types of items.
It sounds like you should just use the link functions instead:

If your just concerned with the tooltips, then search through itemtooltips.lua (for examples, to see how they get the information that they build the item tootlips with) and just do the same thing. Grab the information from the items like they do & write a function to compare them & return if they are the same item or not. Just don't forget to do an early return the first time a match fails.
Lua Code:
  1. GetItemLinkName(itemLink)
  2. GetItemLinkQuality(itemLink)
  3. GetItemLinkEnchantInfo(itemLink)
  4. GetItemQualityStyle(quality)
  5. IsItemLinkUnique(itemLink)
  6. IsItemLinkUniqueEquipped(itemLink)
  7. GetItemLinkItemType(itemLink)
  8. GetItemLinkArmorType(itemLink)
  9. GetItemLinkSiegeType(itemLink)
  10. GetItemLinkWeaponType(itemLink)
  11. exc....
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » item link field 5


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off