is it possible to define wich layer an overlays displays itself in?
I have a beard.dmi wich I use as an overlay on the mob, the problem is:
when he wears a shirt, his beard is not visible since it is under the shirt. It should be over it, plz help!
ID:180800
![]() Feb 14 2001, 11:11 am
|
|
should it be like this?
mob proc AddBeard() var obj beard = new() beard.icon = 'beard.dmi' beard.layer = MOB_LAYER + 0.1 overlays += beard |
should it be like this? Nope. Actually, I don't think this would compile. I think the code I gave you is probably pretty much ready to use... just wherever you want to give a mob a beard, you call AddBeard(). For example: mob bearded_guy New() . = ..() AddBeard() But of course, you probably don't want to do it that way... you probably want to ask players if they want beards. For example, if you wanted to give players the ability to grow a beard at any time, you could do this: mob/verb/grow_beard() usr.AddBeard() //BYOND assumes that usr is a mob, and AddBeard() is a proc belonging to the mob type, so this is OK. |
Just create an object with the beard icon, set that object's layer to MOB_LAYER + 0.1 or something, and then add that object to the overlays list instead of directly adding the icon. Like so:
mob/proc/AddBeard()
var/obj/beard = new()
beard.icon = 'beard.dmi'
beard.layer = MOB_LAYER + 0.1
overlays += beard