the New character part is just fine, its just every time I click load to load the
saved character it comes up with an error. here is the code thats the problem.
mob
Login()
usr.loc = locate(5,5,2)
..()
mob
var
Health
MaxHealth
Class
Exp
ExpNeed
mob
proc
CreateChar(mob/M)
sleep(20)
world << " \blue [usr] has logged on."
alert("Night Wings of the Fallen Ones.","Welcome","Ok")
src.name = input("What would you like to be known as?","Name",src.key)
var/a = input("Choose Your Character")in list("Dark")
if(a=="Dark")
usr.icon = 'mob.dmi'
usr.icon_state = "main"
usr.Health = 25
usr.MaxHealth = 25
usr.Class = "Dark"
usr.Exp = 0
usr.ExpNeed = 30
usr.loc = locate(7,7,1)
SaveChar()
var/savefile/F = new("players/[src.ckey].sav")
var/X,Y,Z
F["name"] << name
F["X"] << X
F["Y"] << Y
F["Z"] << Z
F["mob"] << usr.client.mob
verb
Save()
usr.SaveChar()
usr << "Your character has been saved."
turf/Background
icon = 'Logo.bmp'
name = ""
density = 1
layer = MOB_LAYER+1
turf/nomove
density = 1
turf/NewChar
icon = 'New.bmp'
name = "New"
layer = MOB_LAYER+1
Click()
if(fexists("players/[usr.ckey].sav"))
switch(alert("If you continue with a new character, your previous character will be erased. Do you wish to continue?","[world.name]","Yes","No"))
if ("Yes")
usr << "... Ok... You can now create a new character."
usr.CreateChar()
return ..()
if ("No")
usr << "Ok, Please reconnect for you are being disconnected now and then choose \"LOAD GAME\""
del(usr)
return ..()
else
usr.CreateChar()
return ..()
..()
turf/LoadChar
icon = 'Load.bmp'
name = "Load"
layer = MOB_LAYER+1
Click()
if(fexists("players/[usr.ckey].sav"))
usr.LoadCharacter()
usr << "Welcome back!"
return ..()
else
alert("You don't HAVE an old character here, or it isn't found in our databases!")
return ..()
..()
mob
proc
LoadCharacter()
var/savefile/F
var/X,Y,Z
F = new ("players/[src.ckey]")
F["name"] >> name
F["mob"] >> src
F["x"] >> X
F["y"] >> Y
F["z"] >> Z
src.loc = locate(X,Y,Z)