ID:174593
 
For some really wierd reason my overlay shows up but it is behind the player. I have know idea whats wrong.

obj/clothes/wgi
icon='clothes.dmi'

obj/clothes/wgi/verb/wear()
set src in usr
usr.overlays+=/obj/clothes/wgi

obj/verb/get()
set src in oview(1)
if(Move(usr))
usr << "You got the [src]"
else
usr << "You can't get the [src]"

To make a overlay appear above the player, you want to make sure that the overlays layer var is set to a higher level then the player is.
So in this case youd want to set obj/clothes/wgi/layer = MOB_LAYER + 2.
Look up layer in the reference for a better explaination.
Tokabol wrote:
> obj/clothes/wgi
> icon='clothes.dmi'
> <B>layer=MOB_LAYER+1</B>
>


Add the bold line to your code. The layer just needs to be set higher, so it will display properly. (Though I think overlays should always be default on FLOAT_LAYER)

~>Volte
In response to Volte
I tried changing the layers and it didn't work. I used MOB_LAYER and FLOAT_LAYER. It was working fine before I added in the get verb.
In response to Tokabol
"/obj/clothes/wgi" should be "src" I think. Your adding a path to the overlays, not an atom. That could be it.
In response to DarkView
Ya that was the problem. Thanks.