View Single Post
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