ID:732906
 
Keywords: hud, not, showing
(See the best response by .screw.)
obj
layer=10000
hudMeters
health_01
icon='HP Gauge 1.dmi'
icon_state="0"
New(client/c)
screen_loc="1,11"
c.screen+=src
health_02
icon='HP Gauge 2.dmi'
icon_state="0"
New(client/c)
screen_loc="2,11"
c.screen+=src
health_03
icon='HP Gauge 3.dmi'
icon_state="0"
New(client/c)
screen_loc="3,11"
c.screen+=src
health_04
icon='HP Gauge 4.dmi'
icon_state="0"
New(client/c)
screen_loc="4,11"
c.screen+=src</b>


This is just the object code, I do have everything in place though like setting them to be created upon login (not sure how much code needs to be posted).

ANYWAY, I get no errors or anything, yet NO on-screen objects (even other apart from my health bars) will actually show up on screen. I tried using a couple of HUD sources in the developers section as well, but still no luck. I tried creating another environment from scratch as well and still couldn't get stuff to show up :/

Any help would be MUCH MUCH appreciated.

Do you mind showing a portion of your login code which creates the screen objects?

Another question:
1) Are the icon_states actually named 0? Or do they have no name?
In response to .screw
.screw wrote:
Do you mind showing a portion of your login code which creates the screen objects?

Another question:
1) Are the icon_states actually named 0? Or do they have no name?

        new/obj/hudMeters/health_01(src.client)
new/obj/hudMeters/health_02(src.client)
new/obj/hudMeters/health_03(src.client)
new/obj/hudMeters/health_04(src.client)
src.updateHealth()
proc
updateHealth()
var/percent=round(src.HP/src.MaxHP*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/o in src.client.screen)
o.icon_state=num2text(percent)
spawn(10)
src.updateHealth()


Here is that and yes they are supposed to be 0.
Best response
For debugging purposes, remove the call of src.updateHealth(). Does the HUD appear?

If so, there is something wrong with your percent calculation in updateHealth(). Therefore, I would suggest doing world << percent after the calculation to view the numbers being outputted.
Ah it does show up now! Thank you very much sir!