View Single Post
02/02/15, 11:38 PM   #15
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Even default ZO_SavedVars allows access to saved variables of the different character - using the GetInterfaceForCharacter method.

For example:
Lua Code:
  1. local savedVars = ZO_SavedVars:New("MySavedVarsGlobalTable", 1, {})
This will create interface for saved variables for current character.
If you want to get data for different character, use:
Lua Code:
  1. local savedVarsForDifferentChar = savedVars:GetInterfaceForCharacter("@displayName", "characterName")
  2. --or account wide settings:
  3. local savedVarsAccountWide = savedVars:GetInterfaceForCharacter("@displayName", "$AccountWide")

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).
  Reply With Quote