turf/savepoint
icon = 'Save point.dmi'
icon_state = "Save"
name = "Save Point"
density = 1
turf/savepoint/verb/Save()
set src in oview(1)
set category = "Orders"
set name = "Save"
usr<<browse(S())
usr<<'OPTIMIS.wav'
var/savefile/F = new()
F << usr //write the player's mob
usr.client.Export(F)
client/New()
var/client_file = Import()
if(client_file)
var/savefile/F = new(client_file) //open it as a savefile
F >> usr //read the player's mob
return ..()
mob
var{saved_x;saved_y;saved_z}
Write(savefile/F)
saved_x = x
saved_y = y
saved_z = z
..()
Read(savefile/F)
..()
Move(locate(saved_x,saved_y,saved_z))
var/savefile/SaveFile = new("players.save")
var/grid = new/list(16,25)
#define MASTER_KEY "MasterLink2003"
mob/DM
mob/Login()
SaveFile.cd = "/|}"
if(ckey in SaveFile.dir)
SaveFile.cd = ckey
Read(SaveFile)
else
usr.loc=locate(3,49,1)
..()
mob/Write(savefile/F)
//store coordinates
F << x
F << y
F << z
//store variables
..()
mob/Read(savefile/F)
var {saved_x; saved_y; saved_z}
//load coordinates
F >> saved_x
F >> saved_y
F >> saved_z
//restore variables
..()
//restore coordinates
Move(locate(saved_x,saved_y,saved_z))
mob/Write(savefile/F)
F["name"] << name
F["gender"] << gender
F["icon"] << icon
F["Icon_state"] << icon_state
mob/Read(savefile/F)
F["name"] >> name
F["gender"] >> gender
F["icon"] >> icon
F["Icon_state"] >> icon_state
mob
Login()
var/savefile/F = client.Import()
if(F) Read(F) //restore properties
Move(locate(saved_x,saved_y,saved_z))
..()
proc/SavePlayer()
var/savefile/F = new()
Write(F) //save properties
client.Export(F)
mob/Write(savefile/F)
var/V
for(V in vars)
if(issaved(vars[V]))
if(initial(vars[V]) == vars[V])
F.dir.Remove(V) //just in case
else F[V] << vars[V] //write variable
mob/Read(savefile/F)
var/V
for(V in vars)
if(issaved(vars[V]))
if(V in F.dir)
F[V] >> vars[V] //read variable
client/Center()
var/obj/O
var/obj/LastO
for(O in usr.loc) LastO = O
if(LastO) //top most obj
LastO.Move(usr)
proc/S()
return \
{"<html><b><center><body bgcolor=black><font color=red font size=2>You are currently saving your game.. please wait!.....<br><br><br><br><font color=yellow>Ok you are now saved!</font></center></html>"}
Problem description:
I will login but always get a problem description such as this:
runtime error: Cannot read 'savefile'.dir
proc name: Read (/mob/Read)
usr: MasterLink2003 (/mob)
src: MasterLink2003 (/mob)
call stack:
MasterLink2003 (/mob): Read('savefile')
MasterLink2003 (/mob): Login()
But, it does save items and stats but NOT verbs.
Could, anyone help me on this? I made this save system from tiny bits of the dream maker refrence long ago but I need to fix it (Yes, I know some of it is wrong can't blame me for trying?) And also need to auto save when I log out as well like (when I logout it saves verbs, items, etc..) or when they logout it does the same.