Game Development Community

How to add a vehicle health bar?

by David Bedford · in Torque Game Engine · 04/17/2009 (1:29 pm) · 5 replies

I want do add a health bar like when you look at other players and the green bar shows up to show how much health they have, but I want to do that for vehicles also to show how much health a vehicle has left when you look at it.

It looks like I probably need to edit something in the GuiCrossHairHud::onRender code, I'm just not quite sure what. Anyone got any ideas to try or perhaps already done this? Thanks a bunch for your help

~ Dave

#1
04/17/2009 (2:23 pm)
I created a status control resource that lets you do stuff like this:

www.garagegames.com/community/blogs/view/16287
#2
04/17/2009 (8:10 pm)
I'm not sure if that's what I'm wanting or not but I will certainly take a look and see if I can figure out how to use it. Thanks Jaimi.
#3
04/17/2009 (9:03 pm)
There was either a resource or a forum thread that explained how to hook up vehicles to the health and energy bar(s) -- it was only a one line code change -- I just don't remember where or what it was now.
#4
04/18/2009 (10:24 am)
My apologies, I didn't read further. You're not wanting to track your own vehicle, but others that you see. My resource will not help for that.
#5
04/18/2009 (1:17 pm)
It looks like in the source the object masks for what should render a health bar are in for Vehicles, and I added Turrets, but the little health bar doesn't show up for Vehicles or Turrets.

I tried to see if perhaps a player needed to be controlling the vehicle or turret before the health bar would show up, but that didn't seem to matter.

Any ideas?