Grrrrah *pulling hair*
So I have an add-on that I've been making for my guild for a while, called NameTag, that puts an extra name on the screen when someone chats so we know who's alt is who, etc.
I've always been generating the namelist from a website in php, telling people to copy/paste output to my NTConfig.lua file.
Now, I have a new method of collecting names live in the game as well. What I'd like to do is have these names that are collected on the fly be saved each session.
Currently, when a new character speaks, the following happens:
Code:
if (NTNames[arg2]) then
else
NTNames[arg2] = arg1;
AddedNames[arg2] = arg1;
NT_Echo("Updated temporary database: added "..arg2.." {"..arg1.."}.");
end
Where NTNames is an array of names, arg2 is the character name, arg1 is the 'main' name for the player. This adds the person to both lists, since NTNames is what I call from in all my functions, but that variable is not saved; no, this is what AddedNames is for. I have AddedNames on my ...
Code:
## SavedVariables: DisableBroadcast,AddedNames
Incedentally DisableBroadcast ain't saving either, but, one at a time here.
From advice here, I have added default value for AddedNames should there be no value saved for it in my XML:
Code:
if (event == "VARIABLES_LOADED") then
if (not AddedNames) then
AddedNames = {NIL_NAME="NIL_NAME"};
end
NTmod_initialize();
load_addednames();
end
function load_addednames()
for key,value in AddedNames do
NTNames[key] = value;
end
end
Now, AddedNames is NOT local, and I can't see any reason why it is not being saved.. in fact, nothing is. There is no nametag.lua file appearing in the SavedVariables directory.
Heeeeeellllp!!!