Cool.
I can see this now e.g. in zBag:
|
Source code
|
1
2
3
|
--save both per character, and generically so alts will have a preset
SaveVariablesPerCharacter("zBag_VAR");
SaveVariables("zBag_VAR");
|
So on the first toon nothing is set; when you log out zBag_VAR is saved in both savevariables.lua: when you log on a different toon, the perCharacter is empty so you will see the "main" value; if you change settings they will be saved both for the new char and in the main settings; for the first character it won't matter anymore - I guess, his perCharacter is loaded last and overwrites the one from the main settings (is this a guaranteed rule?). But when logging in on a yet another new character you will see the just updated main settings. Nice mechanism.
Can I clear a variable by simply setting it to nil before a call to SaveVariablesPerCharacter()?
The "per character" is in fact "per character name", right? If you have two toons with the same name on two servers, they will share (and overwrite) each others "per-character" savevariables and other config files, right?