Thread Tools Display Modes
01-24-06, 11:33 PM   #1
Dalar
A Defias Bandit
Join Date: Jan 2006
Posts: 3
Can't save variables for the life of me..

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!!!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Can't save variables for the life of me..


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