mob
verb
Show_HP_Meter()
var/HPPP = /obj/HP
usr.overlays += HPPP
Problem description:When i try to use the verb, nothing happens
ID:263221
![]() Jul 15 2006, 12:15 pm
|
|
Code:
mob Problem description:When i try to use the verb, nothing happens |
![]() Jul 15 2006, 12:21 pm
|
|
you may not be able to see the overlay...try changing the layer its on
|
Shlaklava wrote:
you may not be able to see the overlay...try changing the layer its on obj/HP still nothing happens =/ |
Pharaoh Atem wrote:
Code: mob Problem description: When i try to use the verb, nothing happens You're trying to overlay a type path. You need to create a new instance of the object, THEN overlay it. mob |
Actually, although I never do it myself, overlays list can handle object types added to it. It automatically creates a new image object with the appropriate information according to what an object of that type would have.
The overlays list can handle a lot of odd abuse like that, since it's all done internally all that functionality (abuse proof, from my point of view, which is not always a good thing) is built in. Odd and counter-intuitive I know, but it does work. |
Does your /obj/HP have an icon and icon_state set? What does the code for it look like? The problem can't be in that function that you showed, as that should work fine, and in fact it does for me.
|
obj/HP still nothing happens |
That is odd. Did you overwrite /obj/HP/New at all? Do you have anything else in there that could alter it? Any other /obj/HP information not listed there?
Are you sure the icon_state is correctly set? Are you sure it's not supposed to be "power 100" instead of "power_100"? I can't think of anything else at the moment that could cause it. It works just fine for me when I use the code you showed. |
Loduwijk wrote:
That is odd. Did you overwrite /obj/HP/New at all? Do you have anything else in there that could alter it? Any other /obj/HP information not listed there?I overwrited.I searched, but i only find that.And yes, the state is correct. |