-   General Authoring Discussion (
-   -   Some LUA questions (

Supportic 03/21/19 08:23 AM


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!
Yeah so this is what's bothering me. :D

How long does it take to accept my new SV file name? I wanted to rename the file to give it a clearer name but for some reasons it still takes the old name.
Changes were made in the .txt file and the ZO_SavedVars:NewAccountWide call.

Baertram 03/21/19 08:29 AM

1st: Never use the same name for your SavedVArs AND your global/local addon name. Add something like "_SV" at the end or you'll overwrite your addon table with the SavedVariables.

If you change the SV name you should logout first so everything in memory is gone!
Delete the old SV file then (if you want to) to see if this gets recreated properly with the new contents. In the file there will be the name you have chosen for your SV data at the top of the file. It is also accessible ingame (this name) as a global variable! So you can inspect it via ZGOO.

e..g. your chosen SV name is MyAddon_SV then you can use /zgoo MyAddon_SV after it was created via ZO_SavedVars:...

Double check the manifest txt and your ZO_SavedVars: call if the name is consistent/the same.
Login and then the new SVs should be created in memory. Do a /reloadui ingame and the file should be recreated and the contents updated.

Supportic 03/21/19 09:10 AM

Oooh my bad. The mistake was that I thought that the name of ## SavedVariables defines the name of the output file. Instead it's just the name of the table inside the file. :D
The file name itself defines the :rolleyes:

Baertram 03/21/19 09:50 AM

Nope, the filename of the SavedVars is defined via the foldername and manifest TXT filename of your addon.
None of your addons's tables or variable names has an impact on the addon's "name and SV filename for the game" itsself.

Foldername and txt name = "AddonTest1" -> SavedVariables filename AddonTest1.lua
In your AddonTest1.txt is defined the usage of your file main.lua
In the main.lua is defined the global variable:
AddonTest1 = AddonTest1 or {} = "AddonTest 1 Name"
Filename of the SV -> Still AddonTest1.lua and not "AddonTest 1 Name.lua"

The variable "AddonTest1 in your addon is just used internally in your addon. You can access it from your addon, your addon's other files and other addons (as it is global). But the game won't need this information for loading the manifest TXT filename or building the SavedVariables\<manifest TXT filename>.lua file

I've updated my last post about SVs on the 1st page of this thread!

All times are GMT -6. The time now is 09:30 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2014 - 2020 MMOUI