ID:267126
 
client
proc
Save()
var/firstint=copytext(src.key,1,1)
var/savefile/F=new("[firstint]/[src.key].sav")
for(var/A in src.vars)
F["[A]"]<<A
Load()
var/firstint=copytext(src.key,1,1)
var/savefile/F=new("[firstint]/[src.key].sav")
for(var/A in src.vars)
F["[A]"]>>A

There is my Code, but when I go and Load it, it does not! Any ideas?</<a>
It should be copytext(src.key,1,2)
In response to Nadrew
Still didn't do anything.
In response to DBZ Kidd
Also, you're not saving your vars, if you want to save all vars, use Read() and Write().
In response to Nadrew
I'm still having problems as in when I define a var, and put it in a statpanel it will say HP HP when I have stat("HP",src.HP)
In response to DBZ Kidd
Well, how exactly are you saving now?
In response to Nadrew
mob
Login()
Load()
Logout()
Save()


mob
proc
Save()
var/firstint=copytext(src.key,1,2)
var/savefile/F=new("[firstint]/[src.key].sav")
for(var/A in src.vars)
F["[A]"]<<a
Write(F)<br/> Load()
var/firstint=copytext(src.key,1,2)
var/savefile/F=new("[firstint]/[src.key].sav")
for(var/A in src.vars)
F["[A]"]>>A
Read(F)


That is my exact code.
In response to DBZ Kidd
You don't need the for() loops, period.
In response to DBZ Kidd
Thats what I thought untile I got this error.

save.dm:18:error:src.vars:cannot change constant value
In response to DBZ Kidd
Let me put it this way. You don't need to use your method of saving vars, remove the whole:

for(var/A in src.vars)
F["[A]"]<<A


You don't need it. Read() and Write() do it for you.