ID:146952
 
Yeah, I'm not sure if this would be long in Newbie Central but what the hell..

mob
proc

Expelliarmus(mob/Caster,mob/M)
if(M)
if(Caster.equiped)//21
M.equiped = 0//22
var/obj/wand/W = locate() in M
if(W)
W.loc = locate(M.x-2,M.y-1,M.z)
M << "Your wand was thrown from your hand by [Caster]!"
else
Caster << "You'r attacking a defenseless Wizard!"
else
Caster << "Bug...report to N1ghtW1ng"



Basically what I am trying to do is to check to see if the Caster's wand is equipped, if it is it it will make M's wand go to a location near M. I'm getting the errors

loading HarryPotter.dme
Spells.dm:21:error:Caster.equiped:undefined var
Spells.dm:22:error:M.equiped:undefined var


I labeled the errors with a comment. I think it would be easy to solve..but I have fooled around with it and can't seem to get it to work right. Thanks!
Do they have the variable equiped defined?
In response to Vakir
*Smacks self* Yeah..I defined it as var/equiped, without the mob part to make it work with something else. So yeah now its working thanks!

<EDIT>
Ok now I remember why I did that, I had an obj verb for equip and it would change equiped to !equiped if it was equiped..and vice versa. Now that doesn' work >.>
obj/wand
verb
Equip()
if(!equiped)
equiped = 1
src << "You equip the Wand"
else
equiped = 0
src << "You unequip the Wand"


I am getting that equiped is not defined, I know it's not because I would need to use obj/var or just plain var/. But then that would not work with the other one >.>. Thanks again!
In response to N1ghtW1ng
What happens if it goes through a wall? >_>
You should somehow make it step or something.
In response to Hell Ramen
Well..I think that I am prepared for that with my text parser. It checks to see if a mob is within a certain amount of spaces...oh wait I understand...hmm I'll see maybe I can make it use Step() or something...i'm not to sure. Seeing as with that can't they move and then it misses or something? I'm not to sure how Step works.
In response to N1ghtW1ng
src there is the wand, not the player holding it. You can use usr in this situation to reference the player equiping the wand. In this case, usr.equipped should work.

~X
In response to Xooxer
Score! Nice thanks. Now I can progress in my game!