mob
verb
Save() //The verb Save, which saves your progress.
src.SaveF() //The activation of the SaveF proc.
proc
SaveF() //The proc SaveF which controls the saving of Progress.
var/savefile/F=new("savefiles/[ckey].sav") //This overwrites the file named yourkey.sav
F["last_x"] << src.x //This saves the X Position of the player
F["last_y"] << src.y //This saves the Y Position of the player
F["last_z"] << src.z //This saves the Z Position of the player
F["verbs"] << src.verbs //This saves the Verbs of the player
F["overlays"] << src.overlays //This saves the Overlays of the player
src<<"<font size=2><font color=red>Game Saved</font color></font size>"
Write(F) //This writes the above info.
LoadF()
if(fexists("savefiles/[ckey].sav")) //If yourkey.sav exsists continue.
var/savefile/F = new("savefiles/[src.ckey].sav") //Specifies the var F as yourkey.sav.
Read(F) //Reads the yourkey.sav file from the var F.
var/x,y,z //Sets the vars lx,ly,lz which will be for your X,Y,Z position loading.
F["last_x"] >> x //This loads the X Position of the player
F["last_y"] >> y //This loads the Y Position of the player
F["last_z"] >> z //This loads the Z Position of the player
F["verbs"] >> src.verbs //This loads the Verbs of the player
F["overlays"] >> src.overlays//This loads the Overlays of the player
src.loc=locate(x,y,z) //This places the player at his/her last location.
else //We didnt find yourkey.sav so we have to do this instead.
src << "You have no save file!"
return
Problem description:
Basically no matter what I change, when ever I load, it puts me on top of the load screen and gives me this runtime.
runtime error: Cannot write to atom.verbs.
proc name: LoadF (/mob/proc/LoadF)
source file: Save.dm,25
usr: the kijuhgfvcd (/mob)
src: the kijuhgfvcd (/mob)
call stack:
the kijuhgfvcd (/mob): LoadF()
Star Wars: The New Republic (1,1,1) (/turf/Creation/Start): Click(Star Wars: The New Republic (1,1,1) (/turf/Creation/Start), "mapwindow.map", "icon-x=265;icon-y=319;left=1;s...")
Unrecognized or inaccessible verb: #-;0kbgtdf
To get around this (if you want no verbs and only the saved ones) you can loop through the list and remove them.