View Single Post
01/06/24, 03:11 AM   #6
vsrs_au
Join Date: Dec 2022
Posts: 18
Originally Posted by Dolgubon View Post

The issue here is down to how you are 'counting' the items.
Consider this: If you have two full stacks of say, lockpicks, what would be listed in the saved vars? Or even just two partial stacks of them? Note that when you look at the number of items indicator in a tooltip, it does not differentiate between bank and sub bank.
You could either count them better, or change the table structure so you don't get duplicate entries (or make a cache but that's overkill)
Changing the sv to not differentiate between the bank and sub bank would mean that it would just re-save the same value in the spot for the key, so you'd have one revelry pie amount in the combined bank.
Counting them better would keep the separate entries, so you'd have two entries that add up to the combined total.
However, whichever one you choose, you probably want to re-consider using the item name to save the items. For example, if you have a potion of health, say tripots for tanking and single effect potions for writs and looted potions, then you'd only keep the last item stack size. For example, if you encounter tripots first, you'll save essence of health = 100, then you get to single effect potion and save essence of health = 45 over the existing tripot value of 100. https://wiki.esoui.com/GetSlotStackSize
As far as I'm aware, there isn't really a great way of programmatically designing the table keys to work around this problem. Item IDs are great for many items, but some items share the same item ID despite being different (for example, the aforementioned potions)
Item Link is possible, but many same items do not share the same item link. For example, a tempering alloy in a bank would usually have a different item ID than a tempering alloy in a craft bag.
Unique Item ID I'm pretty sure also does not really work too well, also being too discriminatory for most purposes, but you could experiment with it to see if it works for you.

The best way really is to go a more decision based way. Craft materials use item ID, potions use the level and effect IDs, gear uses the initial portion of the item link or unique ID, etc. Experiment with different item links and keys to find out what works best for you.
Thanks! That's a very detailed and useful answer, and I'll look into improving how I save the inventory counts.

[off-topic] Thanks for the Lazy Writ Crafter addon, by the way, I use it and it's great.
  Reply With Quote