Alright so...I have this little problem with some lists I /barely/ created which should work.
Before I created the new lists I had 2 global lists that I would add players keys and such to. I also have a savefile proc that saves and loads both lists' content.
Now that I created the new lists, the procs I added for them (which are EXACTLY THE SAME as the other lists' procs) keep telling me that error message "Cannot find .null", also when I try to view what's inside the lists (keys etc) It says "Cannot read "personskey".null" bla bla
So basically what the game is telling me is that the new lists aren't lists at all? I just want the new lists to work like my previous ones...I tried making them exactly the same as my 2 lists that work but nope. Help?
ID:273800
May 2 2011, 12:46 pm
|
|
In response to Midgetbuster
|
|
These are the lists
//Lists that do work// Procs that read and check the lists mob/proc And this is what loads them/saves them world So yeah I think this is everything, the verbs I use to add keys and such to the lists consist of the usual "global.BanList.Add(M.key)" and such. |
In response to Paul De La Torre
|
|
You didn't define those lists as global, but are trying to access them with the global keyword. Are the lists defined at the base level, or within another object? Technically, if they're at the base level, it shouldn't make a difference, but it's worth a try adding the global keyword to the definitions.
However, I would say try ditching the global keywords altogether, they're unnecessary unless it's ambiguous to whether you're referencing a local or global variable. |
In response to DarkCampainger
|
|
They actually were -all- global, I just omitted the global part before posting to see whether or not that made a difference. I guess it doesn't, though what do you mean by "Are the lists defined at the base level, or within another object?" I kind of don't understand that. x.x
|
In response to Paul De La Torre
|
|
*BUMP*
|
In response to Paul De La Torre
|
|
Well, here's one other issue, these paths don't match:
var/savefile/T = new("DMK Folder/Server Staff.sav") var/savefile/T = new("Folder/Server Staff.sav") Can you give us the actual full error messages, along with the lines they reference? |
In response to DarkCampainger
|
|
Alright fixed the paths issue, now I think everything loads and saves properly. Now the REAL issue is this:
mob ^ That's the verb used to ban people. Whenever I try to ban someone or manually input text I get this runtime error: Cannot execute null.Add(). So what I am getting from this is...that the Lists are null? Also whenever I try to view what's inside the Lists it says "cannot read null."whateversinsidethelist" |
In response to Paul De La Torre
|
|
I'm gonna take a guess here. Try using this instead to load the saves:
world What I think is happening, is that the server_ban/server_mute/ect didn't exist in the savefile when you first loaded the older version of it (before you added them), so it was loading null into the lists, causing them to be no longer initialized. Then when you went to save them, it stored that null value. With these checks in place, the lists should be re-initialized if the savefile doesn't actually contain a value for it. Alternatively, you could delete the "Server Staff.sav" file, but I'd assume you don't want to lose that data (or is there any data in it?) |
In response to DarkCampainger
|
|
OMG It works now, thank you very very much x.x (also as a side note, I deleted that .sav multiple times and it still didnt work, I guess defining them as lists() when the files were loaded was the best way to go).
|
In response to Paul De La Torre
|
|
one last question though, probably heard this a lot but whenever I search for something in my contents list( which is a default list BYOND has im assuming) there's always this selection at the very top that's just a " why is that?
|
In response to Paul De La Torre
|
|
Paul De La Torre wrote:
one last question though, probably heard this a lot but whenever I search for something in my contents list( which is a default list BYOND has im assuming) there's always this selection at the very top that's just a " why is that? I've actually never heard of that before. Try outputting the contents of the list to see if you have an unnamed object hiding in there: mob/verb/displayContents() And when you say "selection", do you mean you're using input() in contents? Or are you searching in another way? |
Since you say you have the proc already and it doesn't work maybe you could add it here so that we have more context as to what your trying to do and why your getting the error, So respond with the proc and any things that may link to that proc so we can get all data.
But as it stands id say your just failing to initialize the list properly aswell as reading it properly.