ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   Item Id <-> Name (https://www.esoui.com/forums/showthread.php?t=1659)

Criscal 05/28/14 02:09 PM

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

Xrystal 05/28/14 02:17 PM

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.

thelegendaryof 05/28/14 03:37 PM

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)

Shinni 05/28/14 03:37 PM

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.

thelegendaryof 05/28/14 03:53 PM

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 :().

Xrystal 05/28/14 04:29 PM

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.

Quote:

Originally Posted by thelegendaryof (Post 8684)
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)


thelegendaryof 05/28/14 04:33 PM

See here:

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

Cheers :)

Xrystal 05/28/14 04:54 PM

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.

Seerah 05/28/14 05:03 PM

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.

Garkin 05/28/14 06:06 PM

Quote:

Originally Posted by Xrystal (Post 8691)
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.

Xrystal 05/28/14 08:07 PM

Quote:

Originally Posted by Garkin (Post 8693)
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.

Wobin 05/28/14 10:57 PM

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.

Iyanga 05/29/14 04:05 AM

Quote:

Originally Posted by Criscal (Post 8677)
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.

Harven 05/29/14 04:52 AM

Quote:

Originally Posted by Seerah (Post 8692)
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.

Seerah 05/29/14 03:16 PM

Maybe traits do change the number then... But enchants don't. (And, actually, aren't enchants the one that add the suffixes anyway?)

Vuelhering 05/29/14 05:00 PM

Quote:

Originally Posted by Seerah (Post 8755)
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.


All times are GMT -6. The time now is 05:36 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI