ID:159781
 
Ok so I'm finishing up Owner/Admin and so on rights but I don't know how do I make it save this "M.verbs += typesof(/mob/Owner/verb)"
mob
verb
MakeOwner(mob/M as mob in world)
set category = "Staff"
M.verbs += typesof(/mob/Owner/verb)
M.Rank2 = "Owner"


And this is my Save/Load

client
proc
Save()
if(!src)return
if(!src.mob)return
var/savefile/save
save = new ("Player Saves/[mob.ckey].sav")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z
save["verbs"] << src.mob.verbs
Load()
var/savefile/load
load = new ("Player Saves/[mob.ckey].sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
load["verbs"] << src.mob.verbs


So....could you fill me up on this one? ^^
Save the verbs list on the Save() and load it on the Load().

Simple enough.
In response to Andre-g1
runtime error: Cannot write to atom.verbs.
proc name: Load (/client/proc/Load)
usr: Guest-2449684958 (/mob/player)
src: Guest-2449684958 (/client)
call stack:
Guest-2449684958 (/client): Load()
Guest-2449684958 (/mob/player): Login()

i get that when i make it.

client
proc
Save()
if(!src)return
if(!src.mob)return
var/savefile/save
save = new ("Player Saves/[mob.ckey].sav")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z
save["verbs"] << src.mob.verbs
Load()
var/savefile/load
load = new ("Player Saves/[mob.ckey].sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
load["verbs"] >> src.mob.verbs
In response to Destrojer
mob
var/is_owner = 0
proc
MakeMeOwner()
verbs += typesof(/mob/Owner/verb)
Rank2 = "Owner"
is_owner = 1

verb
MakeOwner(mob/M as mob in world)
set category = "Staff"
M.MakeMeOwner()

client
proc
Save()
if(!src)return
if(!src.mob)return
var/savefile/save
save = new ("Player Saves/[mob.ckey].sav")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z
Load()
var/savefile/load
load = new ("Player Saves/[mob.ckey].sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z
if(src.mob.is_owner)
src.mob.MakeMeOwner()

Something like this perhaps?
In response to Immibis
Easier way...just use Write(save) and Read(save) to load and save everything.
In response to Hi1
No. Using the << and >> operators already calls Write and Read, respectively.

What he needs to do is save the verbs list by passing it's value to another temporary dummy list because, AFAIK, you can't save the verbs list directly.
Unfortunately, that owner/admin method isn't exactly the most sound method. Someone who knows how to savefile edit can easily make it so they receive the verbs as well. What you should do is add the verbs to them everytime they log in rather than save the verbs to their key. That way, there's a check that happens, making it harder for a savefile editor to obtain the verbs. I'd use a list check.
In response to Destrojer
The error is self-explanatory; you can't write to the verbs var itself, so you can't set it to reference a new list (such as one obtained from a savefile). To work around this, you'd add the items from the new list to the existing list, so you're never really changing the verbs var.
var/saved_verbs //temp var to store the list
SF["verbs"] >> saved_verbs
src.verbs.Cut() //clear the current verbs list (you could skip this)
src.verbs += saved_verbs //add all the items in the saved_verbs\
list to verbs