Thread Tools Display Modes
11-24-05, 05:26 AM   #1
Ravendwyr
A Flamescale Wyrmkin
 
Ravendwyr's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 139
Question Saved Variables: Converting from Account Level to Character Level

Hello,

Is it possible to convert data saved in the account level SavedVariables folder
(World of Warcraft/WTF/Account/<account>/SavedVariables)

to the character level SavedVariables folder
(World of Warcraft/WTF/Account/<account>/<realm>/<character>/SavedVariables)

without losing any saved data in the process?

Do I just change
## SavedVariables: <data>
to
## SavedVariablesPerCharacter: <data>
or is there some sort of special code I need to add?

Thanks in advance.

- D.I.
  Reply With Quote
11-24-05, 06:19 AM   #2
Elkano
A Flamescale Wyrmkin
 
Elkano's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 131
I don't know it for sure but the way you posted sounds as it would work.
The addon loads it's normal per account file on load and on shutdown it writes it per character.
Since I don't think it will only load those variables noted in the toc there shouldn't be any problem.
But why don't you simply test it on the test realm?
  Reply With Quote
11-24-05, 06:20 AM   #3
Ravendwyr
A Flamescale Wyrmkin
 
Ravendwyr's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 139
I changed my password after November the 8th so I can't yet

Last edited by Ravendwyr : 11-24-05 at 06:22 AM.
  Reply With Quote
11-24-05, 06:27 AM   #4
Elkano
A Flamescale Wyrmkin
 
Elkano's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 131
I haven't enought disc space atm so I can't test for you either
(but I think I'll make some over the we, so maybe I'll look into it... can't wait to test a md5 implementation (using bitlib) ^^)
  Reply With Quote
11-24-05, 07:04 AM   #5
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
If you make that .toc change and then copy the file from the main SavedVariables folder to your characters' SavedVariables you won't lose any data.

However:
- changes to the toc aren't seen until you completely shut down, exit WoW to desktop. So if you change ## SavedVariables to ## SavedVariablesPerCharacter, it won't have any effect until you next start WoW up from desktop.
- When it does log in, it won't see the character-specific SavedVariable, so the mods will create default ones.
- Copying the main SavedVariables to character-specific while in game will be ignored.
- The old main SavedVariables remains in the SavedVariables folder. So you can copy it to character-specific folders if you want to copy settings.

I really hope more mods use it. I prefer all my settings to be the same across all characters.

From a mod-creation view, the change is completely transparent. There's nothing that needs worked around. But if you break a piece away from a table to the per-character tag, you can use the above to your advantage and have a "default" that was the user's setup prior to the switch.
  Reply With Quote
11-24-05, 07:42 AM   #6
Ravendwyr
A Flamescale Wyrmkin
 
Ravendwyr's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 139
So there's no easy conversion code then?
Just edit the TOC whack the SavedVariables file in the character folder and that's it?

That's exactly what I fear.

At the moment, my layout in my SavedVariables file looks like this:
Code:
tf_user_data = {
 [server1] = {
  [player1] = {
   <stuff here>
  },
  [player2] = {
   <stuff here>
  },
 },
 [server2] = {
  [player1] = {
and so on in the account level SV folder. I want it so all this data is ported over to the character folder, so it looks like this:
Code:
tf_user_data = {
 <stuff here>
},
Other people use my project and as not all of them are computer/code savvy I fear that something will go wrong. I don't want to have to make them edit the files to use the new system.
__________________
Twitter | GitHub
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Saved Variables: Converting from Account Level to Character Level


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