Thread Tools Display Modes
12/16/22, 01:59 PM   #1
gandalf.legris
Join Date: Dec 2022
Posts: 5
Can we save variables in SavedVariables in json format(type) ?

Can we save variables in SavedVariables in json format(type) ?
  Reply With Quote
12/16/22, 02:05 PM   #2
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 650
No. We are not allowed to save in other file formats, specify folders or directories, or specify other file names. For example we can't save in CSV either as a coma delimited file. However, you can save a string and then use regular expressions on it and you might be able to come up with something similar.

While you didn't ask but just to cover all the bases. You also cannot load files in other formats, load files from other directories, or load files from specific file names.
  Reply With Quote
12/16/22, 03:44 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,976
No, as Sharlikran alread explained the SV files are saved and read with lua format, at timings that the game defined (login, logout, reloadUI, zone change with laoding screens).
Read the WIKI about SavedVariables, it's all explained there.

We are not able to change the saved data format from lua tables to something else.
But you can use external tools to read/parese that SV files and transfer them to other files and websites how ever you want that to happen, as long as you know there won't be any "live data from the game".
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Can we save variables in SavedVariables in json format(type) ?


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