Thread Tools Display Modes
05/26/14, 02:50 PM   #1
Kraeius
 
Kraeius's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 25
Resetting Saved Variables

I checked each subject in Authoring Discussion category but couldn't find what I'm searching for. Can anyone tell me what are the conditions that make saved variables reset? Currently with each new upload, players lose their saved variables which is very annoying for them.

Probably I do the same thing each time, what can this be? Changing version in .txt or .lua? Adding a new variable? Changing name of a variable? something other?
  Reply With Quote
05/26/14, 03:16 PM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Do you adjust the version number in the SavedVariable function ?

That resets the data contents. I tested it out once to see the effect. So I only actually adjusted it when I had to force a data reset as the data currently set up was wrong. Fortunately just a week after the game came out.
  Reply With Quote
05/26/14, 03:39 PM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Kraeius View Post
I checked each subject in Authoring Discussion category but couldn't find what I'm searching for. Can anyone tell me what are the conditions that make saved variables reset? Currently with each new upload, players lose their saved variables which is very annoying for them.

Probably I do the same thing each time, what can this be? Changing version in .txt or .lua? Adding a new variable? Changing name of a variable? something other?
When you change version of saved variables.

Lua Code:
  1. local sv = ZO_SavedVars:New(savedVariableTable, version, [, namespace], defaults [, profile])

savedVariableTable - The string name of the saved variable table
version - The current version. If the saved data is a lower version it is destroyed and replaced with the defaults
namespace - An optional string namespace to separate other variables using the same table
defaults - A table describing the default saved variables
profile - An optional string to describe the profile, or "Default"

(copy&paste from the comment in zo_savedvars.lua)

Last edited by Garkin : 05/26/14 at 03:41 PM.
  Reply With Quote
05/26/14, 03:57 PM   #4
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
If the version you give in the Settings Object Constructor and the version in the files do not match, the file is ignored and default settings are used.

Note that there is some delay between UI reload and the new data being written to the disk (I use Notepad++ wich informs me if the file changed).

I just reworked the whole settings FAQ part to be a bit clearr in that and other regards.
  Reply With Quote

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