ID:268272
 
How do i save verbs
you could set it up so the verbs are in a list and then you save the list

---- DEMO ---
this is un tested but its a start
mob/var/list/verbslist = new/list() // this is the verb list
mob
proc
save_verbs()
var/savefile/f = new("players/[usr.ckey/[usr.ckey]verbs.dat")
Write(f)
f["verbs"] << src.verbslist
src.verbs -= /mob/proc/save_verbs
src.verbs += /mob/proc/load_verbs

load_verbs()
var/savefile/f = new("players/[usr.ckey/[usr.ckey]verbs.dat")
f["verbs"] >> src.verbslist
src.verbs += /mob/proc/save_verbs
src.verbs -= /mob/proc/load_verbs

verb
add_a_verb()
src.verbs += /mob/proc/save_verbs
verbslist.Add("save_verbs")


In response to Madpeter
Dont get whats the use of saving verbs.
If you save the src.mob of a client everytime it gets deleted you'll be fine.
Byond is object oriented uc . . . but cource u might want to save verbs for some other reason =P

Wonder what reason . . . *hint*
In response to Fint
Fint wrote:
Dont get whats the use of saving verbs.
If you save the src.mob of a client everytime it gets deleted you'll be fine.
Byond is object oriented uc . . . but cource u might want to save verbs for some other reason =P

Wonder what reason . . . *hint*

Here's a reason:

Say if he was making a rpg game, and it involved learning stuff and they had this code:

mob/proc/kick(mob/m in oview(1)
var/damage = src.power
m.hp-=damage

mob
kick_learn_guy
icon='....dmi'
Click()
usr.verbs+=new/mob/proc/kick


And what if he wants to save that instead of going to where the kick_learn_guy is located and learning it all over again?

That is the use of saving verbs.
In response to SSJ4_Gohan_Majin
Yes SSJ4_Gohan_Majin, i think thats what vash means.
If you use Deadron's CharacterHandling library, (which I highly recomend), this is the default behavior. You can also configure the library to not save verbs, if you prefer.