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, 03:37 PM   #4
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   #5
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/28/14, 04:29 PM   #6
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   #7
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   #8
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, 05:03 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Say you have a Keeper's Staff with an item id in the link of 6245. Your Keeper's Staff has a certain trait, giving it a suffix. So it is now called Keeper's Staff of Awesomeness. While questing, you pick up another Keeper's Staff of Awesomeness, but it has slightly different stats. It will still have the same item id in the link. (Though it will have a different instance id.) The next day, you pick up another Keeper's Staff, but this time, it is a Keeper's Staff of Sweetness. It, again, will still have the same item id of 6245 because it is still a Keeper's Staff.
  Reply With Quote
05/28/14, 06:06 PM   #10
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Xrystal View Post
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.
All gathered items (crafting materials) has the same itemId, so it is safe to use.

Problematic it is just with items that have level requirement (equipable items, potions, glyphs) as they can have different stats.
  Reply With Quote
05/28/14, 08:07 PM   #11
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by Garkin View Post
All gathered items (crafting materials) has the same itemId, so it is safe to use.

Problematic it is just with items that have level requirement (equipable items, potions, glyphs) as they can have different stats.
Thanks. Trying to make things as language independent as possible for the database site I am working on but without the ability to retrieve the Link or Name from the ID the idea is moot. The Link is stored in the language it is gathered in so I am not sure how it would be displayed on screen in the history window. And with the node name only being retrievable at the time of interaction it will always be language specific. Similar with mapname.

Maybe later if new API functionality gets added things will change but for now I guess I am stuck with this language limitation. Also, perhaps over time I will see a pattern in the languages imported into the database to eventually export all nodes, items and mapnames in the language requested. Only time will tell.
  Reply With Quote
05/28/14, 10:57 PM   #12
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
I kinda got around the 'storing links in a certain language' issue by using profiles and the Cvar in the SV to store language specific links. It increases the storage requirements for people who swap locales a lot, but space isn't really too much of an issue, and since this is information that can be regenerated at any time, it's not too much hardship.
  Reply With Quote
05/29/14, 04:05 AM   #13
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
05/29/14, 04:52 AM   #14
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
Originally Posted by Seerah View Post
Say you have a Keeper's Staff with an item id in the link of 6245. Your Keeper's Staff has a certain trait, giving it a suffix. So it is now called Keeper's Staff of Awesomeness. While questing, you pick up another Keeper's Staff of Awesomeness, but it has slightly different stats. It will still have the same item id in the link. (Though it will have a different instance id.) The next day, you pick up another Keeper's Staff, but this time, it is a Keeper's Staff of Sweetness. It, again, will still have the same item id of 6245 because it is still a Keeper's Staff.
Hey, this is not true for armor/weapons from sets. For example torug's pact 1h axe with weighted trait has different ID from torug's pact 1h axe with sharpened trait.
  Reply With Quote
05/29/14, 03:16 PM   #15
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Maybe traits do change the number then... But enchants don't. (And, actually, aren't enchants the one that add the suffixes anyway?)
  Reply With Quote
05/29/14, 05:00 PM   #16
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Seerah View Post
Maybe traits do change the number then... But enchants don't. (And, actually, aren't enchants the one that add the suffixes anyway?)
That is correct. I've been looking at this off-and-on for a while.

Traits are inherent in the template id, and the extra data means nothing regarding the traits, but definitely contains the style, level, and enchantments.

There was a little discussion about that in this thread I started a while back.
  Reply With Quote

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

Thread Tools
Display Modes

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