ID:262463
 
Code:
client
proc
Save()
var/savefile/F=new("players.sav")
var/ckey_name=ckey(mob.name)
F["[ckey]/[ckey_name]"]<<src.mob
Load(char_ckey)
var/savefile/F=new("players.sav")
F["[ckey]/[char_ckey]"]>>src.mob
mob
Write(savefile/F)
..()
F["mobx"]<<src.x
F["moby"]<<src.y
F["mobz"]<<src.z
Read(savefile/F)
..()
F["mobx"]>>src.x
F["moby"]>>src.y
F["mobz"]>>src.z


Problem description:
It doesn't load the location. I get a black screen. (Also, it doesn't capitalize the first letter in the name...)
You have to call it.
mob/Choose/Login()
if(fexists("[ckey]/[char_ckey]"))
src.Read()
else
src.NewGame()

Untested, but I believe that will work.
In response to Flame Sage
Oh, sorry. I should've posted this too.
mob/new_chara
Login()
chara_select
switch(input("What do you want to do?")in list("Create Character","Load Character","Delete Character"))
if("Create Character")
src.New_Chara()
if("Load Character")
var/savefile/F=new("players.sav")
F.cd="/[ckey]"
var/list/charas=F.dir
var/choice=input("What character do you want to be?")as null|anything in charas
if(!choice)
goto chara_select
else
src.client.Load(ckey(choice))
In response to Dark Weasel
Do not use goto in this code. You should be using while() instead.

Lummox JR
Your location doesn't load because you're trying to load the x,y,z vars one at a time. You need to load them all to local vars, then set the location from those.

Lummox JR
In response to Lummox JR
Wow, I really feel like a newb now. I got rid of the goto (made it a while) and changed the x, y, z thing. It still doesn't work. I could use all the help I can get.

I'm pretty sure the problem lies in the save/load procs.

client
proc
Save()
var/savefile/F=new("players.sav")
var/ckey_name=ckey(mob.name)
F["[ckey]/[ckey_name]"]<<src.mob
Load(char_ckey)
var/savefile/F=new("players.sav")
F["[ckey]/[char_ckey]"]>>src.mob
mob
Write(savefile/F)
..()
F["mobx"]<<src.x
F["moby"]<<src.y
F["mobz"]<<src.z
Read(savefile/F)
..()
var
newx
newy
newz
F["mobx"]>>newx
F["moby"]>>newy
F["mobz"]>>newz
src.loc=locate(newx,newy,newz)
mob
verb/Save()
src.client.Save()