ID:167400
 
mob
Login()
usr.overlays += new/obj/BHair

obj
Bob
Left_22
icon_state = "Left-2,2"
Click()
world<<"Checking Top_left"
if(/obj/BHair in usr.overlays)
usr.overlays -= /obj/BHair

Why doesnt it work?
I don't believe you need to check for the overlays, just take it off. It'll get rid of it whether it's on there or not. Try getting rid of the if statement and just take it the hair away.
Using usr in login
Forgetting parent proc
'Bob' is mis-indented
Should be if((thingy in something)) Thus, 2 (( ))
In response to Mysame
Mysame wrote:
Using usr in login
It isnt like that in the code, i forgot to copy that part, and I accidently wrote usr. instead of src.

Forgetting parent proc
What exactly do you mean by this?

'Bob' is mis-indented
Again, I didn't copy that part, I just did it right in the page.

Should be if((thingy in something)) Thus, 2 (( ))
That doesnt make any sense.
In response to Strawgate
Forgetting parent proc
What exactly do you mean by this?

The probably most important proc. ..() is used for 'setting everything ready'. This is called by default in New() and Login(), but when you overwrite any of these you need to add it again.

Should be if((thingy in something)) Thus, 2 (( ))
That doesnt make any sense.

It doesn't? Hard to explain, though.
You have
if(/obj/Hair in src.overlays)

I found it work when I used
if((/obj/Hair in src.overlays))

Notice the difference? Could be wrong on this one, but that's how I do it.
In response to Mysame
Mysame wrote:
if(/obj/Hair in src.overlays)

I found it work when I used
if((/obj/Hair in src.overlays))

Notice the difference? Could be wrong on this one, but that's how I do it.

You are wrong. You shouldn't be needing the double parenthesis. overlays is a special list and you can't find a type path in it I think. The way I do it, I make a separate list called Overlays, loop through that, and if it is in there then you can subtract, or whatever you want to do.
In response to Strawgate
Whoops, I didn't catch the usr at login().

Anyway, the parent would be ..(). This is called at the start of login.

mob/Login()
..() //like this


The parent *..()* is also at Logout(), New(), Del(), and some others I think I may have missed.

And again, I don't believe the if statement is neccessary. Just removing it will work whether it's there or not, I think.
In response to Kalzar
The thing is, Kalzar, that's what I do too, so that might be the cause =P
In response to Pyro_dragons
Yeah, um ..() isn't the parent. ..() calls the parent_procedure so like mob/NPC/DeathCheck() ..() would call mob/DeathCheck()..()

When it is used in a built-in proc, it calls the default. So for New() it will actually create the atom.
In response to Kalzar
Kalzar wrote:
So for New() it will actually create the atom.

Nope. By the time atom/New() is called, the object would have already be created, and its variables initialized (except for the /client type), so not calling ..() wouldn't actually stop the object from being created.

~~> Unknown Person