ID:158959
 
I am trying to save the location of a player. I tried saving loc to a save file, didn't work. I also tried saving the x y and z vars to it, but that did'nt work. So how do i do tihs?
Location? Do write/read procs, works for me.

I'd do
var/savefile/F = new
F["last_x"] = mob.x

ect

then when you read it, do
F["last_x"] >> mob.x


This may require a saving library though, I can't recall.
Use the forum search (like you always should before asking a question), this was completely covered tons of times.
EDIT: This particular common question is even covered in the DM Guide itself, ffs. http://www.byond.com/docs/guide/chap12.html
There are about a million of save/loading libraries ready to be abused.

The idea is to save the x,y,z coordinate to a temporary var, add it to the save and later extract it and set the player's coords accordingly.