ID:263237
 
Code:
src.overlays -= src.statoverlay
var/obj/overlay/stat/P = new/obj/overlay/stat
P.icon_state = null
P.icon_state = "[src.status]"
if(src.multitile)
P.pixel_y += 32
src.statoverlay = P
src.overlays += src.statoverlay


Problem description:
I have a stats system that works, and recently I've added multi-tiled sprites to my game. The issue with this is that the location of the status image is wrong, so I tried to change it.

However, when I did so, I noticed that, even though the code seemed right, nothing changed. The status was still displayed in the same place as for normal mobs! I ran a lot of debugging to see whether it was that the overlay wasn't being replaced, or if it was the wrong one but nope, it's the right overlay, it's being replaced, and it's totally ignoring changes made to pixel_y.

Any ideas?

EDIT: Fixed a spot of code that was displaying wrong for some reason e_e

EDIT 2: cwkgkl4v4 GRRRR. Well I found the issue. There was another proc elsewhere overriding the above and thus causing my problem. Bloody heck why is it always the EASY things that cause me the hours of pain?!
If this is for the statpanel, there's your problem. The statpanel can't work with pixel offsets.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
If this is for the statpanel, there's your problem. The statpanel can't work with pixel offsets.

Lummox JR

Oh no, this isn't FOR the statpanel, this is just managed by the stat panel. I'm getting annoyed cause all the other icons' pixel_y's work except this one -_-
Try outputting what the icon_state is showing.

src<<"P: [P.icon_state]"
src<<"src: [src.icon_state]"
In response to Vizuke
Vizuke wrote:
Try outputting what the icon_state is showing.

> src<<"P: [P.icon_state]"
> src<<"src: [src.icon_state]"
>


The icon state is fine, and it's even using the correct icon and src and all that. It's like it arbitrarily decided not to work... hang on I have an idea!

EDIT: Idea failed -_- I tried giving it its own icon, and also clearing out the rsc. All failed.