Thread Tools Display Modes
12/21/14, 03:31 AM   #21
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by circonian View Post
I don't think what I wanted is possible. I know some of you were already saying that. I'm mainly posting this for anyone else interested who reads this post.

I ran into another problem. Although I can get the library to work with multiple addons reading & writing the saved variables to each addons saved variable file doing the above. I realized that if a user installed a NEW addon that had the library included AND that addon got loaded first, it would have no saved variables yet for that saved variable table and thus wipe out all saved variables when it is loaded.

So I guess stand alone with its own saved variables would be the only way.

Thanks again everyone for all of your advice.
What about the approach to use "ZO_Ingame_SavedVariables"? Too dirty?
  Reply With Quote
12/21/14, 05:52 AM   #22
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by votan View Post
What about the approach to use "ZO_Ingame_SavedVariables"? Too dirty?
I'm glad you mentioned that! Actually..I never used one of those namespaces before. I was going to come back and look at it later, to try and figure out how it worked, after reading the other posts. But I just forgot about it.

One of Garkins examples:
Lua Code:
  1. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "Provisioner", defaults)

So how would I use it? I'm guessing all I need to do is just use a unique namespace? So just something like:
Lua Code:
  1. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "LibNeed4ResearchVars", MyDefaultVarTable)
and...I'm guessing thats all there is to it?

What about the version number? If I changed the version number would it wipe out ALL of ZO_Ingame_SavedVariables? Or just MY namespace?
  Reply With Quote
12/21/14, 06:22 AM   #23
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by circonian View Post
I'm glad you mentioned that! Actually..I never used one of those namespaces before. I was going to come back and look at it later, to try and figure out how it worked, after reading the other posts. But I just forgot about it.

One of Garkins examples:
Lua Code:
  1. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "Provisioner", defaults)

So how would I use it? I'm guessing all I need to do is just use a unique namespace? So just something like:
Lua Code:
  1. self.savedVars = ZO_SavedVars:New("ZO_Ingame_SavedVariables", 1, "LibNeed4ResearchVars", MyDefaultVarTable)
and...I'm guessing thats all there is to it?

What about the version number? If I changed the version number would it wipe out ALL of ZO_Ingame_SavedVariables? Or just MY namespace?
- Yes, you need just unique namespace.
- If you increase version number, it will reset to defaults just your namespace. Nothing else.
  Reply With Quote
12/21/14, 06:36 AM   #24
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Garkin View Post
- Yes, you need just unique namespace.
- If you increase version number, it will reset to defaults just your namespace. Nothing else.
Awesome, thanks Garkin.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Libraries & 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