View Single Post
03/21/19, 08:14 AM   #20
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,959
SV are ONLY updated on the hardrive/SSD as you do a reloadui or zone change or logout. This is normal and intended.

SVs are not updated on your hdd/sdd as you change them. The data will be changed in your variables of your addon. And just kept there until a reloaduiw rites them.

If you change something in the SV data of your addon and do no reloadui or logout or zone change (e.g. client crashes) the data will not be written to your hdd/sdd.

There is a security SV setting though for this to save small amounts of IMPORTANT data. Currently I cannot find the info but wil llink it here as I did again.

You cannot access files within ESO. Only using the SVs is possible. So if you want to transfer data on the fly there is no choice to do this so far, only with a reloadui.

You internal SV table will be kept in memory as well. So if you change the file manually via text editor the next reloadui wil loverwrite the file on the hdd/sdd again from the memory ingame!

If you want to reset the savedvariables you need to set them nil ingame and do a reloadui.
OR you can use the SavedVariables version parameter in ZO_SavedVars:... functions! Increasing/changing the version will reset the savedvariables! SO never use the save version number for your addon + the savedvariables or they will reset EACH time you change the addon version.

There also exists a library to help with the SavedVariables in your addons:
https://www.esoui.com/downloads/info...SavedVars.html

Edit:
SV information: https://www.esoui.com/forums/showthr...=savedvariable
SV tutorial: https://wiki.esoui.com/Circonians_Sa...ables_Tutorial
Clean SV data: https://www.esoui.com/forums/showthr...=savedvariable
Using character bound and account bound SVs at the same time in your addon (e.g. general account wide settings + character settings for each toon): https://www.esoui.com/forums/showthread.php?t=7953
Info about libSavedVars and some other SV related stuff: https://www.esoui.com/forums/showthr...savedvariables


SV saving of small IMPORTANT data without reloadui (do not abuse it or it might break other addons REALLY IMPORTANT save of small data!): No link, just some information about functions:
• RequestAddOnSavedVariablesPrioritySave(addonName)
This function prioritizes the add on to be saved before non-prioritized add ons. After a save it will no longer be marked as a priority.
You may also disable auto saving for your add on by putting the following line at the top of your addon manifest file:
• ## DisableSavedVariablesAutoSaving 1
Hint from ZOs: I think that if you call the priority function (RequestAddOnSavedVariablesPrioritySave) it will do one save even if it is disabled in the manifest (## DisableSavedVariablesAutoSaving 1)

Linked it to the Wiki's SV tutorial now:
https://wiki.esoui.com/Circonians_Sa...oadui.2Flogout

Additional forum thread with insights:
https://www.esoui.com/forums/showthread.php?t=8407

Last edited by Baertram : 03/21/19 at 09:55 AM.
  Reply With Quote