Thread Tools Display Modes
03/02/14, 01:11 AM   #1
Myrroddin
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 28
Multiple saved variables

Based on the Wiki, most things that have multiple entries in the toc/txt file are space-delineated. If you have more than one SV file, does it follow this pattern, or do you need 2, 3, etc SavedVariables entries?
  Reply With Quote
03/02/14, 01:54 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
What do you mean by, "If you have more than one SV file" ?
  Reply With Quote
03/02/14, 05:37 PM   #3
Myrroddin
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 28
I mean if you want, say, MyAddOn_SV and MyAddOnDB. One would be general settings, the other could be character specific, with both in the same AddOn. You could do this in WoW, so I'm guessing you can do this in ESO. I just want to know the syntax in the .txt file, whether the two are separated by spaces or commas or listed on two lines.

The other option would be one SV file, where you would have MyAddOnDB.universal_setting.someSetting and MyAddOnDB.character_setting.someSetting.

Think of how AceDB allowed this. You could have MyAddOnDB.profile.someSetting and MyAddOn.Seerah.someSetting.

The second option would be better, but I could work with either. Just wondering how you would set it up.
  Reply With Quote
03/02/14, 05:41 PM   #4
Errc
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 30
Originally Posted by Myrroddin View Post
I mean if you want, say, MyAddOn_SV and MyAddOnDB. One would be general settings, the other could be character specific, with both in the same AddOn. You could do this in WoW, so I'm guessing you can do this in ESO. I just want to know the syntax in the .txt file, whether the two are separated by spaces or commas or listed on two lines.

The other option would be one SV file, where you would have MyAddOnDB.universal_setting.someSetting and MyAddOnDB.character_setting.someSetting.

Think of how AceDB allowed this. You could have MyAddOnDB.profile.someSetting and MyAddOn.Seerah.someSetting.

The second option would be better, but I could work with either. Just wondering how you would set it up.
No need to make multiple saved vars files. Can make separate SV for character specific or for the whole account.

Code:
sv.char = sv.char or ZO_SavedVars:New( SvName , version , "main" , defaultChar )
sv.profile = sv.profile or ZO_SavedVars:NewAccountWide( SvName , version , "main" , defaultAccount )
  Reply With Quote
03/02/14, 05:47 PM   #5
Myrroddin
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 28
Originally Posted by Errc View Post
No need to make multiple saved vars files. Can make separate SV for character specific or for the whole account.

Code:
sv.char = sv.char or ZO_SavedVars:New( SvName , version , "main" , defaultChar )
sv.profile = sv.profile or ZO_SavedVars:NewAccountWide( SvName , version , "main" , defaultAccount )
Ah, thank you. I've been pouring over the Wiki with no luck or love trying to find the following syntax:

* ZO_SavedVars
* EVENT_MANAGER
* CHAT_SYSTEM
* CALLBACK_MANAGER
* others?

If I had found ZO_SavedVars, I might have been able to answer this myself. Where are they documented, if they are?
  Reply With Quote
03/02/14, 06:29 PM   #6
Errc
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 30
Originally Posted by Myrroddin View Post
Ah, thank you. I've been pouring over the Wiki with no luck or love trying to find the following syntax:

* ZO_SavedVars
* EVENT_MANAGER
* CHAT_SYSTEM
* CALLBACK_MANAGER
* others?

If I had found ZO_SavedVars, I might have been able to answer this myself. Where are they documented, if they are?
http://wiki.esoui.com/AddOn_Quick_Questions
  Reply With Quote
03/02/14, 06:44 PM   #7
Myrroddin
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 28
Okay, that's a start, and thank you. I missed that. But it still leaves me with things like ZO_SavedVars:New() and :NewAccountWide(), d (really, "d" is print??) and some others. How did you guys figure out all the variants to those APIs?
  Reply With Quote
03/02/14, 09:50 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
d() is their dump(), really.

Even in WoW, when listing two saved variables in the .toc (or .txt here) file, there is only one saved variable *file* created, it just has both saved variables in it. The difference with WoW, was that you could have a line in the .toc to create account saved variables and a line to create character specific saved variables. If you wish to do something automated like that, you need to use ESO's saved variables API for the profiles.

Otherwise, you are still able to create and use saved variables that are created manually, without using their API layer on top of it. (Think of the ESO saved var API as AceDB)
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Multiple saved variables


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