mob
proc
Load_Player()
if(fexists("Savefiles/[ckey].sav"))//Checks in save files if the save file is there.
var/savefile/F = new("Savefiles/[ckey].sav")//creates a variable F
Read(F)// Reads the Save file.
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
F["Icon"] >> src.icon
var/destination = locate(last_x, last_y, last_z)
loc = destination
return 1
else
return 0
Save()
/*for(var/shadow/SH in underlays)
underlays -= SH
del SH*/
var/savefile/F = new("Savefiles/[ckey].sav")
Write(F)
//GenerateShadowMob2(src,SOUTH)
return 1
Read(var/savefile/F)
..()
Write(var/savefile/F)
..()
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z
F["Icon"] << src.icon
F["User"] << User
Problem description:
I am getting this error:
runtime error: cannot append to list
proc name: Read (/mob/Read)
source file: System - Save & Load.dm,34
usr: (src)
src: Joel (/mob)
src.loc: null
call stack:
Joel (/mob): Read(Savefiles/zoblod.sav (/savefile))
Joel (/mob): Load Player()
Joel (/mob): Access()
So can you guys help me see what i am doing wrong. And as well nothing happens when i try to load the player the screen just freezes.
You can replace your Write proc with this:
btw.. don't save the icon to the savefile