View Single Post
02/03/15, 12:06 AM   #16
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
Even default ZO_SavedVars allows access to saved variables of the different character - using the GetInterfaceForCharacter method.

However it is more suitable for copying settings from one character to another. It will not help you with iterating over the existing account/character names stored in the table and you will need keep list of chracters somewhere (probably in account wide settings).
Nice, learned something new. Didn't know about that one.

But you made me think, so I will also add, in case he wanted/needed to iterate the table without keeping a list of character names, he could do something like this:
Lua Code:
  1. local tAccountData = _G["MySavedVarsGlobalTable"]["Default"]["@displayName"]
  2. for sCharName, tCharSavedVars in pairs(tAccountData) do
  3.     if sCharName ~= "$AccountWide" then
  4.         -- tCharSavedVars = character saved var table for sCharName, do whatever with it
  5.     end
  6. end
  Reply With Quote