ID:149255
 
var/savefile/F = new(usr.ckey)
F.cd = "Saves"
F << usr


ok thats my saving code, but its not saving to the Saves directory like i thought, i suck with saving, codes so how would i make it so it makes the save file within the Saves diectory?
Here is afew more saving ways


mob
var
save_x
save_y
save_z
Write(savedfile/F)
save_x = x
save_y = y
save_z = z
..()
Read(savefile/F)
..()
Move(locate(save_x,save_y,save_z))


mob
Login()
var/savefile/F = new(ckey)
Read(F)
del(src)
return..()
Logout()
var/savefile/F = new(ckey)
Write(F)
del(src)



another way



mob
Write(savefile/F)
F["name"] << name
F["icon"] << icon
Read(savefile/F)
F["name"] >> name
F["icon"] >> icon


that was a basic way


another way -


mob
Write(savefile/F)
F << x
F << y
F << z
..()
Read(savefile/F)
var{save_x;save_y;save_z}
F >> save_x
F >> save_y
F >> save_z
..()
Move(locate(save_x,save_y,save_z))


another way


client/proc/SaveMob()
var/savefile/F = new("players.sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"] << src.mob

client/proc/LoadMob(char_ckey)
var/mob/new_mob
var/savefile/F = new("players.sav")
F["/[ckey]/[char_ckey]"] >> new_mob
if (!new_mob)
return 0
else
src.mob = new_mob
return 1



those are afew saving ways.

RaeKwon
This is part of a library I was making, and stopped, and need to finish it, because it takes 5 minutes. Lazy. Bah.

var/banlist[]
world
New()
..()
var/savefile/F = new ("ban.lst")
F >> banlist
if(isnull(banlist))
banlist = new /list

mob/admin/verb
boot(mob/M in world)
world << "[usr] has booted [M]!"
del(M)
ban(mob/M in world)
world << "
[usr] has banned [M]!"
world << "[usr] has booted [M]!"
banlist += M.key
if(M.client)
banlist += M.client.address
del(M.client)
var/savefile/F = new ("ban.lst")
F << banlist
del(M)

mob
Login()
if(banlist.Find(src.key) || banlist.Find(src.client.address))
usr << "You are BANNED!"
del(src)
return
if(src.key == "Polatrite")// Note: you MUST change this to YOUR KEY!
src.verbs += /mob/admin/verb/ban
src.verbs += /mob/admin/verb/boot
world << "
[src] has logged in!"
var/savefile/F = new("players/[src.ckey].sav") // Here's where we declare where the file is saved
Read(F)

Logout()
world << "[src] has logged out!"
var/savefile/F = new("players/[src.ckey].sav")
Write(F)



It has a simple banning system, and saving too, should work fine, just adapt it to your code.
In response to RaeKwon
Did you even read his question? In all of that you didn't answer it once.
In response to Nadrew
Nadrew wrote:
Did you even read his question? In all of that you didn't answer it once.

oh well bean awake 26 hours, not all with it eh

RaeKwon
In response to Nadrew
We offered a more than effective replacement code which he can view, edit, and learn from. Why don't you quit being the idiotic forum police representative, and just reply with some actual helpful information?
In response to RaeKwon
RaeKwon wrote:
oh well bean awake 26 hours, not all with it eh

You have no idea..
In response to Polatrite
Polatrite wrote:
We offered a more than effective replacement code which he can view, edit, and learn from.

He can't learn from something that has nothing to do with what he asked, and I wasn't replying to your post, your's was actually helpful.

Why don't you quit being the idiotic forum police representative

I highly doubt I'm idiotic, and I wasn't really enforcing any rules/laws, so the forum police remark was totally off.
In response to Nadrew
No. I simply see you replying with this form of attitude on most forum posts, in general. Maybe I am just having a bad day and feel like being a jerk. Lesbian Assassin banned me from Hedgerow Hall, which happens to be my favorite game, just because I said she should change the Read() proc around so she doesn't have to pfile wipe, as multiple pfile wipes tend to piss people off, and they tend to LEAVE the GAME, which results in less players. Whatever.
Ok heres another thing im stumped on, like i said i suck with saves =p
No players have some of thier vars in client, the rest are under thier mob, now how do i save all them to 1 file and recall them later?
WildBlood wrote:
        var/savefile/F = new(usr.ckey)
F.cd = "Saves"
F << usr


To answer your question. F.cd changes the directory inside the savefile, not where the savefile is located, use this instead.

        var/savefile/F = new("Saves/[usr.ckey]")
F << usr


In response to Polatrite
Polatrite wrote:
No. I simply see you replying with this form of attitude on most forum posts, in general. Maybe I am just having a bad day and feel like being a jerk. Lesbian Assassin banned me from Hedgerow Hall, which happens to be my favorite game, just because I said she should change the Read() proc around so she doesn't have to pfile wipe, as multiple pfile wipes tend to piss people off, and they tend to LEAVE the GAME, which results in less players. Whatever.

Lemme guess, though: she said something along the lines of "Don't tell me how to code," and you were persistent.