~Sky, Your Nightmare~
Administrator
Sky, your Steroid Abusing Nightmare...
99%
Your Nightmare....
Posts: 121
|
Post by ~Sky, Your Nightmare~ on Nov 20, 2008 23:49:33 GMT -5
mob proc Save() var/savefile/F = new("[src.key].sav") Write(F,usr.loc) ..()
Login() world << "<font color= blue><u><b><i>[usr] has Logged on!</i></b></u></font>" ..() if(src.key=="XSky RiderX") world << "<font color=gray><font size =4>Sky the Obedient Legendary Coder has logged on!!!</font></size>"
.=..()
if(fexists("[src.key].sav")) switch(input("Do you wanna load or New Game?","Load/New Game") in list ("Load","New Game")) if("Load") var/savefile/F = new("[src.key].sav") Read(F,usr.loc) usr << "<b>Welcome back to Pokemon Topaz, [src.name]</b>"
That is probably 1/10 of my Login proc, and I do not feel like showing all of it since there are people who tend to copy and paste coding and claim it's theirs. But anyways, this is the main part to it. The problem is is that I want it to be able to Save the usr's Location, Yet, when I go on, it only saves my dir, stats, and stuff like that. And I'm back again at (1,1,1). If you want me to show my Logoff proc, I could if that's what you need.
|
|
|
Post by X- Ace -X on Dec 6, 2008 10:56:57 GMT -5
mob proc Save() var/savefile/S = new/savefile("Players/[usr.ckey].sav")
S["last_x"] << x S["last_y"] << y S["last_z"] << z
Write(S)
Load() if(fexists("Players/[usr.ckey].sav")) var/savefile/S = new/savefile("Players/[usr.ckey].sav") Read(S)
var/last_x var/last_y var/last_z S["last_x"] >> last_x S["last_y"] >> last_y S["last_z"] >> last_z
var/destination = locate(last_x, last_y, last_z)
if (!Move(destination)) loc = destination
This is what I usually use, and I think I got the location saving/loading from the DM Guide. You can use it if you want.
|
|
~Sky, Your Nightmare~
Administrator
Sky, your Steroid Abusing Nightmare...
99%
Your Nightmare....
Posts: 121
|
Post by ~Sky, Your Nightmare~ on Dec 7, 2008 21:33:26 GMT -5
Cool, thanks, I don't really go through the DM Guide much. I usually watch Youtube Videos, or read a few tutorials on here. I should start reading it now
|
|