Thread Tools Display Modes
12/13/14, 01:38 AM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
UniqueId

Is there a way to save a uniqueId in a saved variable so you can later compare it to the uniqueId of an item in an inventory to see if its the same item? I had no problems saving it in a variable and using it, but when it gets written to the saved variable file it just comes out 0.

Unless I was just doing something wrong above, I found this: Id64ToString(id64 id) and thought maybe I could just do something like:
Lua Code:
  1. local uniqueStringId = Id64ToString(GetItemUniqueId(bagId, slotId))
  2. savedVars.ItemInfo[uniqueStringId] = ...Stuff...
  3.  
  4. -- then later after reload do something like:
  5. local uniqueStringId = Id64ToString(GetItemUniqueId(bagId, slotId))
  6. local stuffTable = savedVars.ItemInfo[uniqueStringId]

I tested it a little, it seemed to work, but I'm wondering if anyone knows if that will still be unique after converting it to a string?

Last edited by circonian : 12/13/14 at 01:43 AM.
  Reply With Quote
12/13/14, 09:52 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Yes, Id64ToString is the only way you can save the value, and it has to be unique, otherwise that function would be pointless
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » UniqueId


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