mob
Login()
//if(save==1)
if(src.LoadProc())
else
switch(alert("What race would you like to be?",,"Wizard","Red Court Vampire"))
if("Wizard")
src.icon='Players.dmi'
src.icon_state="Wizard"
else
src << "The Red Court Race is not yet available."
src.name = input("Choose a name for yourself.") as text
if(lentext(name) < 2)
src << "Your name must have more than 2 letters in it."
else if(lentext(name) > 10)
src << "Your name must have less than 10 letters in it."
else
src << "You have now been named."
src.loc=locate(5,5,1)
src.AdminCheck()
mob
Logout()
src.SaveProc()
del src
mob/proc/SaveProc()
var/FileName="Players/[ckey(src.key)].sav"
if(fexists(FileName)) fdel(FileName)
var/savefile/F=new(FileName)
F["Admin"]<<src.Admin
F["Health"]<<src.Health
F["MaxHealth"]<<src.MaxHealth
F["Energy"]<<src.Energy
F["MaxEnergy"]<<src.MaxEnergy
F["Strength"]<<src.Strength
F["Endurance"]<<src.Endurance
F["Power"]<<src.Power
F["Resistance"]<<src.Resistance
F["Accuracy"]<<src.Accuracy
F["Dodge"]<<src.Dodge
F["Exp"]<<src.Exp
F["Healing"]<<src.Healing
F["Recovery"]<<src.Recovery
F["HealthMod"]<<src.HealthMod
F["EnMod"]<<src.EnMod
F["StrMod"]<<src.StrMod
F["EndMod"]<<src.EndMod
F["PowMod"]<<src.PowMod
F["ResMod"]<<src.ResMod
F["AccMod"]<<src.AccMod
F["DodgeMod"]<<src.DodgeMod
F["HealMod"]<<src.HealMod
F["RecovMod"]<<src.RecovMod
F["LastX"]<<src.x
F["LastY"]<<src.y
F["LastZ"]<<src.z
save=1
src<<"Character Saved..."
mob/proc/LoadProc()
var/FileName="Players/[ckey(src.key)].sav"
if(fexists(FileName))
var/savefile/F=new(FileName)
F["Admin"]<<src.Admin
F["Health"]<<src.Health
F["MaxHealth"]<<src.MaxHealth
F["Energy"]<<src.Energy
F["MaxEnergy"]<<src.MaxEnergy
F["Strength"]<<src.Strength
F["Endurance"]<<src.Endurance
F["Power"]<<src.Power
F["Resistance"]<<src.Resistance
F["Accuracy"]<<src.Accuracy
F["Dodge"]<<src.Dodge
F["Exp"]<<src.Exp
F["Healing"]<<src.Healing
F["Recovery"]<<src.Recovery
F["HealthMod"]<<src.HealthMod
F["EnMod"]<<src.EnMod
F["StrMod"]<<src.StrMod
F["EndMod"]<<src.EndMod
F["PowMod"]<<src.PowMod
F["ResMod"]<<src.ResMod
F["AccMod"]<<src.AccMod
F["DodgeMod"]<<src.DodgeMod
F["HealMod"]<<src.HealMod
F["RecovMod"]<<src.RecovMod
src.loc=locate(F["LastX"],F["LastY"],F["LastZ"])
src<<"Character Loaded..."
return 1
Problem description:
I am trying to get this to save a character when they log out, and when they return, if they have a save file, it will load otherwise they will be prompted to create a character.
I took the save code from Falacy's tutorial on it, and tried to implement it here, but for some reason it simply won't work. I get no errors, but it will not load. I'm rather stumped, as I'm new to coding, so if anyone could help me resolve this I'd be much obliged.
F[]>>stat
Not:
F[]<<stat