Game Development Community

Health bar displaying 2 colors (HUD)

by Dejan Vukobratovic · in Torque 3D Professional · 05/09/2010 (7:29 am) · 1 replies

Hello, in our game we have implemented a choice that allows players to pick between 2 teams (Teams Implementation resource). By default, when hovering the mouse over a friend or an enemy, a health bar will be displayed like this:

img217.imageshack.us/img217/3348/reticle.png
What I want to do is to modify this health bar to be for example red (instead of green) when hovering over a player that belongs to the opposite team. I have looked at a resource called Torque TeamId, but I cannot find the files that end with .h or .cc . We are using Torque 3D for our game while that resource was based on TGE/TGEA (maybe with source code modifications, which we don't have access to in our version of T3D), so it would be great if someone could point me in the right direction.

#1
05/10/2010 (5:34 am)
You hit the nail on the head there, the .h & .cc files are the source files.

It should be able to be done in script but it wont be as efficent. There are visability controls built right into torque script for GUI elements. Just do a dump of an object in the console to get them. ( objectName.dump() or objectID.dump() ) and perhaps some sort of onTick rayCasting. Sorry that I don't know where a good place to put the raycasting would be.