#define DEBUG
mob
proc
Save()
var/savefile/F=new("saves/[src.ckey].sav")
src.Write(F)
F["lastx"] << src.x
F["lasty"] << src.y
F["lastz"] << src.z
F["icon"] << src.icon
F["items"] << src.contents
F["verbs"] << src.client.verbs // this.
Load()
var/savefile/F = new("saves/[src.ckey].sav")
src.Read(F)
var/newx
var/newy
var/newz
F["lastx"] >> newx
F["lasty"] >> newy
F["lastz"] >> newz
src.loc=locate(newx,newy,newz)
F["verbs"] >> src.client.verbs // this.
F["icon"] >> src.icon
F["items"] >> src.contents
Problem description:
I just spent a good 10 minutes searching the forum, only to find that this hasn't come up anywhere.
Closest thing I could find: http://www.byond.com/developer/forum/?id=714727
Look at the commented lines, what would I have to put there in order to save and load the verblist correctly?
I have tried mob.verbs, src.verbs, src.mob.verbs (<-- lol.), and simply client.verbs. :\
I most definitely do not want to have to put them in a list, I've never been good at working with those. haha
Also note that you are not saving properly. This would be proper:
Note that for things like verbs and icon, I strongly suggest you instead store the data in other variables, and derive the icon or verbs from that instead. IE: if you want to give the verb "pray" to anybody who is religious, instead save whether they are religious or not and re-give them the verb in Read() if they are religious. Similar deal for icon. The issue is that if you need to change verb paths around for some reason, old savefiles will no longer be valid if you do so. As for icons, the entire file is stored in the savefile otherwise (you will need to do F.dir -= "icon" to prevent saving it) which bloats the file and also means changing the icon leaves people with the old icon.