Thread Tools Display Modes
05/01/14, 03:11 AM   #1
DerVagabund
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 12
Identifying items - different methods?

Hello,

currently I use item names in order to recognize items - but this is not very well suited for different languages because of different translations. Is there another way how to identify item without using the name? As for the documentation of API functions I did not find any method that gives me an ID for a given item, except the lootid, which is per session and not unique to special items. What I would like to have would be at least for crafting mats an id I can use instead of the material name.

I am open for any suggestions

Thanks,
best regards,
DV
  Reply With Quote
05/01/14, 03:20 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Lua Code:
  1. local link = GetItemLink(bagId, slotId)
  2. local itemID = select(4,ZO_LinkHandler_ParseLink(link))

BTW you can find itemIDs on Esohead - it is the number in URL:
http://www.esohead.com/items/23103.
  Reply With Quote
05/01/14, 04:48 AM   #3
DerVagabund
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 12
Ah, so these are the correct values? I already wrote a programm to mine esohead data but I was not sure if that data is accurate.

But thanks for the tip to parse the link - didn't know there as a function provided.

Is there a list of these ZO_xx functions somewhere?
  Reply With Quote
05/01/14, 05:18 AM   #4
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
Use Zgoo add-on. You can browse through... pretty much anything. Wish we had those .lua files in the 000.dat though...
  Reply With Quote
05/01/14, 11:42 AM   #5
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 644
Is there a way to get the item link from just the ItemID?
Lua Code:
  1. local link = GetLink(ItemID)
That is totally made up, but is there one that will do that?
  Reply With Quote
05/01/14, 11:53 AM   #6
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Sharlikran View Post
Is there a way to get the item link from just the ItemID?
Lua Code:
  1. local link = GetLink(ItemID)
That is totally made up, but is there one that will do that?
No, because an itemId is just an id for an item template, not an id for an instance of an item. You can have multiple items with the same itemId in your bagpack.
  Reply With Quote
05/01/14, 12:29 PM   #7
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
Originally Posted by Iyanga View Post
No, because an itemId is just an id for an item template, not an id for an instance of an item. You can have multiple items with the same itemId in your bagpack.
You say that, but an item's "itemInstanceId" is also the same for the same items.
  Reply With Quote
05/01/14, 12:42 PM   #8
ins
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 76
itemID + Enchant = ItemName
itemID + itemQuality 49/50 = ItemName (Unique/Named items)


This is what I use to get some item info.


Lua Code:
  1. -- strip the gear and return a lot of stuff that was asked...
  2. local function stripGear(itemLoc)
  3.         local itemFILTER= GetItemFilterTypeInfo(1, itemLoc)  -- 1/2 weapon/Apparel
  4.         local itemTRAIT = GetItemTrait(1,itemLoc)
  5.         local itemTYPE  = GetItemType(1,itemLoc)
  6.         local link = GetItemLink(1, itemLoc)   
  7.        
  8.         local name,col,typID,id,qual,levelreq,enchant,ench1,ench2,un1,un2,un3,un4,un5,un6,un7,un8,un9,style,un10,bound,charge,un11=ZO_LinkHandler_ParseLink(link)
  9.         local icon,stack,sellprice,meets,locked,equiptype,itemstyle,quality = GetItemInfo(1,itemLoc)
  10.         -- whinstone, a02ef7, item, 45159, 5,   36,  26848,  5, 36,  0,   0,  0,  0,  0,  0,  0,  0,  0,  6,    0,    0,   368,   0
  11.         --   name      color, type,  id,  qual, lvl,  ench, str, str,un1,un2,un3,un4,un5,un6,un7,un8,un9,style,un10,bound,charge, un11
  12.     if insJY.SVG.debug == true then
  13.         d(link)
  14.         d("Texture: "..tostring(icon))
  15.         d("Itemname: "..tostring(name))
  16.         d("Type: "..GetString("SI_ITEMTYPE",itemTYPE).. " - Filter: "..GetString("SI_ITEMFILTERTYPE", itemFILTER))
  17.         d("ID: "..tostring(id))
  18.  
  19.         d(qual)
  20.         local colour=QualCol(quality)
  21.         d("Quality: "..tostring("|c"..colour.." - "..qual.." - "..quality))
  22.  
  23.         if tonumber(itemTRAIT)>0 then
  24.             d("Trait: "..tostring(itemTRAIT).."-"..GetString("SI_ITEMTRAITTYPE",itemTRAIT))
  25.         end
  26.         d("Bound: "..tostring(bound))
  27.         -- weapon/armor related
  28.         if itemFILTER==ITEMFILTERTYPE_ARMOR or itemFILTER==ITEMFILTERTYPE_WEAPONS then
  29.                 d("Level Required: "..tostring(levelreq))
  30.                 d("Enchant: "..tostring(enchant).. " - Strenght: "..tostring(ench1).."-"..tostring(ench2))
  31.                 d("Style: "..tostring(style).. " - "..GetString("SI_ITEMSTYLE", style))
  32.         end
  33.         -- weapon related
  34.         if itemFILTER==ITEMFILTERTYPE_WEAPONS then
  35.                 d("Charges: "..tostring(charge))
  36.         end
  37.     end
  38.        
  39.     return name,tonumber(id),tonumber(quality),tonumber(sellprice),tonumber(levelreq),enchant,tonumber(style),tonumber(bound),tonumber(itemFILTER),tonumber(itemTRAIT),tonumber(itemTYPE)
  40. end
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Identifying items - different methods?


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