Thread Tools Display Modes
09/29/14, 10:02 AM   #1
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Storing unique id for item

Hello, I am wondering if it's possible to store a item instance id in saved variables. If so, Is it possible to create an item link from the item instance id? I'm assuming instance id's are unique for similar items, is this true?

Thanks
  Reply With Quote
09/29/14, 10:44 AM   #2
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
i can only tell, according to the ItemSaver plugin for example - if items have the same name - they all would be marked by this plugin, not only one item

i might help or not, but looks like there is unique type of items, but you cant name one item by unique Id, if you have more thn one of this item with the same name
  Reply With Quote
09/29/14, 10:49 AM   #3
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Item Instance Id is an integer that isn't garaunteed precise.

Item UniqueID is an Id64 value that loses precision when saved as a string.
Id64 values can't save directly to SavedVariables without first being converted to string.

Of the 2 I prefer UniqueID. Instance ID can change for the same item as it shifts between bags, and can point to multiple items and not a specific unique item. IE: if you had 2 of the same item, it would potentially find both.

Unique ID value changes when you convert it to string and you can't convert it back to Id64, though. So, effectively you would save the Id64 value converted to string to your SavedVariables and then you would parse the bags to find the matching item when you loaded up and compare the saved string value to tostring(Id64) from the unique from your bag, and that gets you the closest. Then you can get ItemLink using (bag, slot) after you find your match.

Conversely you could save the ItemLink as a string to SavedVariables and just show that when needed, or use it to parse things, etc.

The Id64 system they implemented works great until the values need to be saved off to file. Then it basically starts to break down. :/
  Reply With Quote
09/29/14, 11:06 AM   #4
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Thanks for the detailed response. I'll go ahead and save the item link rather than the Id, I was hoping to be able to minimize the variable size by using a smaller value to represent an item object but... I guess I'll have to use the item link.

Thanks again!
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Storing unique id for item


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