ID:145510
 
Code:
//This is a part of client/proc/Load()
var/mob/Player/P
F["Save"] >> P
//Below the version of the savefile is checked, the ships loaded, and the player put onto thier ship.


Problem description:
Ok, I swear my save system give me the most problems out of my whole game. For some ungodly reason, the player is all of a sudden logging in right as their mob is loaded. Before, it loaded the mob, set up the variables and ran the checks, then the client logged into the mob at "mob = P". But now the client is logging in too early and the mob isn't correctly set-up!

Does anyone know any kind of saved information that could cause the client to login to a mob without being told to?


[Edit] Just to clarify, this is supposed to load the mob
I had this same exact problem awhile back. (Clicky) I'm guessing you're trying to access data from the savefile. As Crispy's posts suggest, that you make sub-directories, or other data entries for the file. =P
In response to Mega fart cannon
Hmmm, I appear to have forgotten to mention this was a Load procedure >_>
I want the mob to load. My problem is that I don't want the client to connect to it until I can make some changes.

Thanks for trying :)
If I completely missed your point and you knew it was for loading, sorry. I have a headache, so it's not my fault, it's my brain's ;)
In response to DarkCampainger
Uhm... put a sleep() in there?
In response to Mechanios
No, sadly I don't think that would work :(
Is there a way to stop the client from automatically connecting to the loaded mob? Or to find out why it is connecting to it?

Thanks for trying :)
In response to DarkCampainger
Alter client/Login() or client/New()?
In response to Jp
I'm not sure about this.
But if a mob loads with its key var as a key of a client connected. Would it connect the client to the mob then?
In response to Dever
Yes it would, and that is probably his problem.
In response to Dever
Hmmm... That makes sense. Does anyone know how to not save the key? I tried the following, but it set client to null, which then meant it couldn't Export() the save:
//This is under /mob/Player/proc/SaveGame()
var/C = key
key = null
F["Save"] << src
key = C


Thanks, Any ideas?
In response to DarkCampainger
Locate the key directory in the savefile and output null to it.
F["Save/key"] << null

I'm not sure exactly what the path to the key directory would be, but wherever it is it would use the same principle.
In response to Loduwijk
Urg, I can't seem to get any of this stuff to work :'(
I tried to use some code to find where the key is stored, but all is outputs is "Save"
F["Save"] << src
for(var/A in F.dir)
src<<A
F.cd = "/[A]"
for(var/B in F.dir)
world<<B


Thanks for helping me through this guys, savefiles are my worst subject :(
In response to Loduwijk
It's much simpler than that. Just use DM's built-in procedures.
mob
Write(savefile/F)
..()
F["key"]<<null
Read(savefile/F)
..()
In response to Teh Governator
... THANK YOU!
Finally I can get back to work on the update :)
Also, thanks to everyone else for helping me get this far and replying so quickly :D

Also, I should note that "..()" should come first or else it will just re-save the key. Just incase someone has the same problem and finds this thread :)