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:
local uniqueStringId = Id64ToString(GetItemUniqueId(bagId, slotId))
savedVars.ItemInfo[uniqueStringId] = ...Stuff...
-- then later after reload do something like:
local uniqueStringId = Id64ToString(GetItemUniqueId(bagId, slotId))
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?