ID:1638430
 
(See the best response by Nadrew.)
Code:
mob
var
expgive=0
jutsus = list()
//--------------------
mob
proc
SaveK()
if(src.cansave)
var/savefile/F = new("TSCv3 players/[src.key].sav")
src.V = src.verbs
src.xco = src.x
src.yco = src.y
src.zco = src.z
Write(F)
//src << "<font color=red><b>Your game has been saved!"


Problem description:
I keep getting this runtime error that wouldn't surface a with any other list but its having issues with the jutsus list for some reason
runtime error: Failed to write variable V to savefile TSCv3 players/Joejoe13.sav. The value being written was /list (/list).
proc name: SaveK (/mob/proc/SaveK)
source file: Saving And Loading.dm,71
usr: Joejoe13 (/mob)
src: Joejoe13 (/mob)
call stack:
Joejoe13 (/mob): SaveK()
Joejoe13 (/mob): AutoSave()
Joejoe13 (/mob): AutoSave()

Someone please help me figure this one out
Best response
Even setting a variable to 'verbs' won't directly allow you to save it, and you should never have to save the verbs list, verbs should be done in a way where their addition and subtraction is an automated thing, that doesn't rely on hacky methods of saving the verbs list.

Say you have admin commands, those should obviously never be saved, because those should be added when an admin logs in, for the most security.

Or, you have skills based on basic mob verbs, that's just a bad way of doing it. Skills should be attached to some kind of object that belongs to the player, said object would contain the verb(s) associated with the skill. There are even better ways to handle this with dynamic verb naming and generic usage handlers but that's not really worth getting into at this juncture.

To resolve your issue quickly you can change src.V to 'src.verbs.Copy()' and it should allow you to save things, but you can't directly load that saved list into the verbs list and will have to loop over it and add the entries to verbs upon loading. It's not the ideal solution as I said above, ideally you wouldn't need to save and load verbs.
In response to Nadrew
i kinda get what your saying, i have verbs connected to objets but some are not connected to objects and how would i make such a saving system where it doesn't save verbs? i dont exactly understand