Thread Tools Display Modes
05/28/14, 02:09 PM   #1
Criscal
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 14
Item Id <-> Name

Hi,

you can extract item ids from item-links e.g. retrieved with GetItemLink(bag,slot). What I didn't find yet is a way to get the name from an object id - or am I just blind. Is there any way to achieve that?

Thanks,

Criscal
  Reply With Quote
05/28/14, 02:17 PM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
That is one thing I hate, not seeing that GetItemName(ID) function. I have been having to store the name of the item because of this. But no, you're not going blind.
  Reply With Quote
05/28/14, 03:37 PM   #3
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
Those ID 's aren't a unique Identifier. Meaning it 's only a Template ID. There is no unique ID known/accessible which would ultimately identify an item. One could construct it with Enchantment + Template-ID + Level-Requirement + Quality but that 's bound to have a lot of duplicated and wrong entries for example for Legendary or Set-Equipment.

However:

http://www.esoui.com/downloads/info4...izedItems.html

Lua Code:
  1. function LocIT:GetIdsFromItemName(name, language)

However that only works with Template-Names and returns all ID 's for it (for example "Greatsword" or unique Itemnames). I didn't implement a method to search for constructed names (the names you see in Tooltips and Itemlinks) yet. If you'd like that I could implement it in the next version to get the correct (LVL and Qualitybound) Base-ID. Weh sounds a bit confusing I know ...

ESOHEAD for example holds mostly Template-Names:

http://esohead.com/items#

Feel free to have a look at the Source-Code of "Localized Items" to get to know it better - and/or use it as a dependency. Wouldn't recommend to include/copy it in your own addon as it holds data of over 16.000 templates that 's a) much data and b) bound to be outdated if one doesn't manage it from time to time (which I do)

Last edited by thelegendaryof : 05/28/14 at 03:51 PM.
  Reply With Quote
05/28/14, 04:29 PM   #4
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
oh. So the item:xxxxx part of the item link is not the item id for that item ? As in ALL Iron Ore will have say 803 as the number after item ( 803 is a guess from memory ). I know there is an instance ID which is retrievable with GetItemInstanceId(bagId1,slotIndex1) but I am sure this shows a different number to the item:xxx number and is different between the same named item. Initially I thought it was the source of the item ( node, dead body etc ) but there was no consistency there either. The only thing that does make sense in my mind is if item:xxxx is unique per same named item and instanceId is generated as an id for the item after looting, crafting etc.

Originally Posted by thelegendaryof View Post
Those ID 's aren't a unique Identifier. Meaning it 's only a Template ID. There is no unique ID known/accessible which would ultimately identify an item. One could construct it with Enchantment + Template-ID + Level-Requirement + Quality but that 's bound to have a lot of duplicated and wrong entries for example for Legendary or Set-Equipment.

However:

http://www.esoui.com/downloads/info4...izedItems.html

Lua Code:
  1. function LocIT:GetIdsFromItemName(name, language)

However that only works with Template-Names and returns all ID 's for it (for example "Greatsword" or unique Itemnames). I didn't implement a method to search for constructed names (the names you see in Tooltips and Itemlinks) yet. If you'd like that I could implement it in the next version to get the correct (LVL and Qualitybound) Base-ID. Weh sounds a bit confusing I know ...

ESOHEAD for example holds mostly Template-Names:

http://esohead.com/items#

Feel free to have a look at the Source-Code of "Localized Items" to get to know it better - and/or use it as a dependency. Wouldn't recommend to include/copy it in your own addon as it holds data of over 16.000 templates that 's a) much data and b) bound to be outdated if one doesn't manage it from time to time (which I do)
  Reply With Quote
05/28/14, 04:33 PM   #5
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
See here:

http://www.esoui.com/forums/showthread.php?t=1316

Cheers
  Reply With Quote
05/28/14, 04:54 PM   #6
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Thanks, just confirms my decision not to use that item:xxxx number as an identifier in my gatherer item data. I already have to use Locale based names for nodes and maps already so it's no biggy to keep the item names as locale based, as it currently is, as well.
  Reply With Quote
05/28/14, 03:37 PM   #7
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
maybe you can get an items name via the tooltip control.
as you may have noticed, the item name gets translated if you click on a foreign item link in chat.
so maybe, if you create a fake link with the item id and pass it so the tooltip control via SetLink(string aLink), you can access the item's real name.
  Reply With Quote
05/28/14, 03:53 PM   #8
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
No - I - Seerah - and probably the whole ESOHEAD team have been there for countless hours already.
You can't get the Item-Data out of the Tooltips in any way (with the API).
If you find a way feel free to post a tutorial (but I doubt it ).

Last edited by thelegendaryof : 05/28/14 at 03:55 PM.
  Reply With Quote
05/29/14, 04:05 AM   #9
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Criscal View Post
Hi,

you can extract item ids from item-links e.g. retrieved with GetItemLink(bag,slot). What I didn't find yet is a way to get the name from an object id - or am I just blind. Is there any way to achieve that?
Wrong point of view.

The item link IS your item id. It just isn't a number.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Item Id <-> Name


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