ID:264599
 
Code:
mob
proc
Save()
var/savefile/F = new("Saves/[usr.ckey]")
F["last_x"] << src.x
F["last_y"] << src.y
F["last_z"] << src.z
F["Icon"]<<usr.icon
F["dir"]<<usr.dir
F["name"]<<usr.name
F["icon_state"]<<usr.icon_state
F["Level"]<<usr.Level
F["Statstr"]<<usr.Statstr
F["StatDef"]<<usr.Statdef
F["Statkidef"]<<usr.Statkidef
F["Statki"]<<usr.Statki
F["Statpowerlevel"]<<usr.Statpowerlevel
F["Statmaxki"]<<usr.Statmaxki
F["Statmaxpowerlevel"]<<usr.Statmaxpowerlevel
F["Realstr"]<<usr.Realstr
F["RealDef"]<<usr.Realdef
F["Realkidef"]<<usr.Realkidef
F["Realki"]<<usr.Realki
F["Realpowerlevel"]<<usr.Realpowerlevel
F["Realmaxki"] << usr.Realmaxki
F["Realmaxpowerlevel"] << usr.Realmaxpowerlevel
usr<<"Game Saved"
Write(F)
Load()
if(fexists("Saves/[usr.ckey]"))
var/savefile/F = new("Saves/[usr.ckey]")
Read(F)
F["last_x"] >> src.x
F["last_y"] >> src.y
F["last_z"] >> src.z
F["Icon"]>>usr.icon
F["icon_state"]>>usr.icon_state
F["dir"]>>usr.dir
F["name"]>>usr.name
F["Level"]>>usr.Level
F["Statstr"]>>usr.Statstr
F["StatDef"]>>usr.Statdef
F["Statkidef"]>>usr.Statkidef
F["Statki"]>>usr.Statki
F["Statpowerlevel"]>>usr.Statpowerlevel
F["Statmaxki"]>>usr.Statmaxki
F["Statmaxpowerlevel"]>>usr.Statmaxpowerlevel
F["Realstr"]>>usr.Realstr
F["RealDef"]>>usr.Realdef
F["Realkidef"]>>usr.Realkidef
F["Realki"]>>usr.Realki
F["Realpowerlevel"]>>usr.Realpowerlevel
F["Realmaxki"]>>usr.Realmaxki
F["Realmaxpowerlevel"]>>usr.Realmaxpowerlevel


Problem description: When i save Character, it Only Saves Def and Locs, The Realstr and the other variables doesnt save.

1) You should not be calling Read() or Write() directly. Use the << and >> savefile operators instead.
2) You should not be manually saving all of those variables. Anything not declared as tmp will be saved automatically by Write(), and anything else (like x,y,z) should be saved by overriding Write() and Read().
3) You should not be abusing usr.
In response to Garthor
That of usr, i added it to check something but it was src :)

oh and tmp? what that??? =o
In response to Revolution Gohan
Use the DM Reference.
In response to Kaioken
Oh, i know it now, so if i set my vars to tmp vars, i dont need use this save system right? and for save i use Read(F) and Save(F) No?
In response to Revolution Gohan
No. If you set your variables to be tmp, they won't be saved automatically. And the proper way to save a mob is with F << mob and the proper way to load a mob is with F >> mob.