ID:141707
 
Code:
            if(clonecount==2)
usr<<"<font color=Yellow>Through hard work you have learnt the double clone spell"
usr.verbs+=new/mob/proc/dbl_clone
proc
dbl_clone()
set category="Spells"
if(usr.curmana <= 40)
usr << "<font color=Red>Not enough Mana"
return
flick("seal",usr)
var/mob/summon/clone/M1 = new/mob/summon/clone(locate(usr.x+1,usr.y,usr.z))
M1.icon=src.icon
flick('smoke.dmi',M1)
var/mob/summon/clone/M2 = new/mob/summon/clone(locate(usr.x-1,usr.y,usr.z))
flick('smoke.dmi',M2)
M2.icon=src.icon
src.curmana-=40


Problem description: The code is working perfectly, or so I think. The problem is after loading the save game, you will lose the ability to use the spell as it doesnt appear in the tab. Im not sure whats wrong with it so any help will be greatly appreciated.

Verbs are not saved automatically. You have to do it yourself.
In response to Andre-g1
Ahh gotcha, thanks for the help ive got it working now.
In response to BurGuDan
Sorry to bother you again, but i managed to save the verbs, but it made other things fail, would it be possible for you to show me how its meant to turn out?

mob
verb
SaveChar()
set name = "Save"
var/savefile/F = new("players/[src.ckey].sav")
F["name"] << name
F["X"] << src.x
F["Y"] << src.y
F["Z"] << src.z
F["Mob"] << usr.client.mob
F["Verbs"] << verbs
usr << ("<font color=White>Your character has been saved")

mob
proc
LoadCharacter()
var/savefile/F = new("players/[src.ckey].sav")
var/X
var/Y
var/Z
var/mob/newmob = new()
F["name"] >> name
F["X"] >> X
F["Y"] >> Y
F["Z"] >> Z
F["Mob"] >> newmob
F["Verbs"] >> verbs
newmob.loc = locate(X,Y,Z)
newmob.client = src.client

In response to BurGuDan
What other things ?

Also, you don't need to create a dummy mob to hold the new stuff, just use the mob the client is currently on, upon Login().
I'd like to point out that dbl_clone should be defined as a verb rather than a proc...
usr.verbs+=new/mob/proc/dbl_clone


And just as a useful piece of info, when creating a new object, you don't have to specify the type if it's already defined in the variable:
var/mob/summon/clone/M1 = new(locate(usr.x+1,usr.y,usr.z))

Helps save a little space and typing time
In response to Ephemerality
It actually doesn't have to be a verb. In a game with a lot of combat, sometimes it is better to define them as procs under the player mob; it opens up new possibilities, such as a random attack attack.
In response to Jeff8500
Jeff8500 wrote:
It actually doesn't have to be a verb. In a game with a lot of combat, sometimes it is better to define them as procs under the player mob; it opens up new possibilities, such as a random attack attack.

Point taken. That being the case however, he should probably eliminate the use of "usr" in the proc. IIRC, it would work fine if used as a verb but could cause problems as a random attack under certain circumstances...
In response to Ephemerality
Got it working now thanks for all the help.