Game Development Community

Suggestion: add health and energy bar rendering to GuiShapeNameHud

by Daniel Buckmaster · in Torque 3D Professional · 10/22/2013 (4:15 am) · 5 replies

Or, should there be a separate control that does this? In TGE, the GuiShapeNameHud would render a health bar above each named ShapeBase. That functionality seems to have mysteriously disappeared. I need it (and energy bars) for vlrtt, so I'll be adding it back in - just wondering if other people are missing it.

EDIT: Wait... digging back into my TGE code, there doesn't seem to actually be any health bar rendering, despite it being mentioned in the comments for the class. I was sure I'd seen that stuff working. Hrm. Well, does anybody want it anyway?

EDIT: Ahem. The T3D comment still reads "This control displays the name and damage value of all named ShapeBase objects on the client." Well.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
10/22/2013 (6:22 am)
Feel free to stick it in - I don't use the thing anyhow! :P
#2
10/22/2013 (6:26 am)
It might still be there partially - drop a cheetah into your level and look at it. No name, but there is a health bar....
#3
10/22/2013 (9:00 am)
Feeding off of Richards comment I think that the code is still there as well. I took out the code %player.setShapeName(%name); because it would render the AI's name at waist level; it seemed distracting for me at the time, but I may want something like this in the future when I get the AI to finally have all of their daily tasks planned out. Currently it is too generic and the radioactive green looks silly for the color scheme I have; I would need more control over the font and even have some border abilities, but I have not looked too deeply into the predefined code.
#4
10/22/2013 (9:33 am)
The reticle or crosshair hud (whatever it is called) renders a healthbar when directly over a named ShapeBase object.

Perhaps all of those "fps" GUI controls should be cleaned up and made more generic instead?


@DreamPharaoh: the color is editable, the font is editable, and there is a vertical offset property built in.
#5
10/22/2013 (1:29 pm)
Oh, of course, I was thinking of the crosshair! Well at least I'll be able to rip that code off ;P.

DreamPharaoh, you can now also render a coloured box and frame around the labels.

Mike, yes, I do believe some cleanup is in order. My instinct would be to make each function a separate control. One that renders a name, one that renders a health/energy bar, and one that does a crosshair. The current crosshair-with-health-bar would be accomplished using a crosshair image and a small energy bar render control at the centre of the screen.