Okay! First of all, what is the deal with switches? I have seen hundreds of different uses, and formats of them. Some like : switch(buildinglist) , some like : switch(input("BLERB?", "Shopkeeper",text) in list ("Black Shirt","Red Shirt")). Can someone tell me how to use these properly and efficiently?
Also with the switch(buildinglist) type, they always had something in the ( )'s after the verb bit, e.g. AskShop(e.t.c), is there a way of doing this outside of the ( )'s ?
Now to the saving bit.
I use this :
mob
verb
Save()
var/savefile/F = new(ckey)
Write(F)
usr << "Saved!"
usr.saved = 1
Load()
if(usr.saved)
var/savefile/F = new(ckey)
Read(F)
usr << "Loaded!"
else
usr << "You've never saved, so you can't load!"
usr << "We shall give you a new character!"
sleep(2)
usr << "Initializing"
sleep(1)
usr<<"."
usr.Cash = 700
sleep(2)
usr<<".."
sleep(1)
usr<<"."
sleep(5)
usr.Name = usr.key
usr.loc = locate(2,2,1)
usr<<"Complete!"
Write(savefile/F)
F["last_x"] << x
F["last_y"] << y
F["last_x"] << z
Read(savefile/F)
..() //Defualt of read is to restore the variables
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_x"] >> last_z
src.loc=locate(last_x,last_y,last_z)
From Airjoes simple saving system, but it has a problem. How can I make it save all of the persons lists and variables? Because at the moment it doesn't!
Thank you!
~GokuSS4Neo~
I'll go fix it now. You can do it yourself for that code.