ID:148077
 
I get this error:

runtime error: Cannot execute null.SaveMob().
proc name: Logout (/mob/Logout)
usr: Guest (/mob)
src: Guest (/mob)
call stack:
Guest (/mob): Logout()

whenever I log out. My save code is:

client/proc/SaveMob()
var/savefile/F = new("players.sav")
var/char_ckey = ckey(mob.name)
F["[ckey]/[char_ckey]"] << mob
mob.saved_char = 1

and my login/logout code is:

Login()
..()
if(saved_char)
client.LoadMob()
loc = locate(/area/start)
else
CreateNewChar()
Logout()
client.SaveMob()
..()
with your logout code
Logout()
client.SaveMob()
..()

try using src instead of client

Logout()
src.SaveMob()
..()

or even if u use
client/Del()
src.Savemob

one of them should work
In response to Lazyboy
SaveMob() is a client proc
I managed to eliminate the runtime error by changing
this:
 Logout()
> client.SaveMob()
> ..()

to this:
 client/Del()
client.SaveMob()
..()

but now it won't save, and keeps asking me for character creation whenever I boot up the game.
Delita12345 wrote:
Logout()
client.SaveMob()
..()

I believe the problem here is that by the time Logout() is called, the client has been disconnected so there is no client.

I don't have access at the moment, but you can check

http://developer.byond.com/hub/Deadron/CharacterHandling

to see how it was done there.