mob/proc/Save()
var/savefile/F=new("savefiles/[usr].sav")
F["HP"] << hp
F["name"] << name
F["gender"] << gender
F["str"] << str
F["dex"] << dex
F["int"] << int
F["con"] << con
F["soul"] << soul
F["luck"] << luck
F["char"] << char
F["det"] << det
usr << "<font size = 20 color= red>Game Saved.</font>"
mob/proc/Load()
if(fexists("savefiles/[usr].sav"))
var/savefile/F=new("savefiles/[usr].sav")
Read(F)
F["HP"] >> hp
F["name"] >> name
F["gender"] >> gender
F["str"] >> str
F["dex"] >> dex
F["int"] >> int
F["con"] >> con
F["soul"] >> soul
F["luck"] >> luck
F["char"] >> char
F["det"] >> det
mob/verb/save()
Save()
Problem description:
I know this may look not well done but it works.(For HP,name and gender)It's not working for str to det.
Anyone know why?
Thanks in advance.
You don't need to save every individual variable. Just the mob itself which contains the variables. The mob is loaded with all of it's information.
Post [link]