ID:268590
 
What am I doing wrong? No HP Bar shows up on the screen.
obj/HUD/HP_Bar
icon='HPbar.dmi'
pixel_y=6
layer=5

mob
New()
..()
var/obj/HUD/HP_Bar/HBAR = new
HBAR.name="[name]"
overlays+=HBAR
Perhaps this would work:

obj/HUD/HP_Bar
icon='HPbar.dmi'
pixel_y=6
layer=5

mob
New()
..()
var/obj/HUD/HP_Bar/HBAR = new
HBAR.name="[src.name]"
src.overlays+=HBAR


Note i said PERHAPS.
Ryne Rekab wrote:
What am I doing wrong? No HP Bar shows up on the screen.
> obj/HUD/HP_Bar
> icon='HPbar.dmi'
> pixel_y=6
> layer=5
>
> mob
> New()
> ..()
> var/obj/HUD/HP_Bar/HBAR = new
> HBAR.name="[name]"
> overlays+=HBAR
>


No, it doesn't show up on the screen. You didn't ever tell it to show up on the screen. At the moment, it's being created in null, so you don't see it. If you want to add it to client.screen, or to a spot on the map, you'd have to put that in.
In response to Jon88
I believe he wants it as an overlay which does make it show up on the screen.