Quantcast Some LUA questions - Page 2 - ESOUI
Thread Tools Display Modes
03/21/19, 08:23 AM   #21
Supportic
Join Date: Mar 2019
Posts: 24
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.

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.
  Reply With Quote
03/21/19, 08:29 AM   #22
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,529
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.
  Reply With Quote
03/21/19, 09:10 AM   #23
Supportic
Join Date: Mar 2019
Posts: 24
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.
The file name itself defines the Addon.name.
  Reply With Quote
03/21/19, 09:50 AM   #24
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,529
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 {}
AddonTest1.name = "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

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

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

ESOUI » Developer Discussions » General Authoring Discussion » Some LUA questions

Thread Tools
Display Modes

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