Game Development Community

dev|Pro Game Development Curriculum

Coded Numeric Health Indicator

by Xavier "eXoDuS" Amado · 01/22/2002 (6:49 am) · 6 comments

Download Code File

Hi there and welcome to my new tutorial :)
Well this is actually a version 2 of the original numeric health indicator, but more than a version 2 is a complete remake. This one doesn't use any scripting at all, so if you used my last tutorial you should remove all the script changes and follow this new instructions.

Download the zip file and unzip both files to your engine/gui/ directory.
Now add them to your project in the gui folder (i assume you know how to do that already dont you?)
Then recompile the binary and run the game.
Now once inside the game you'll need to add the GuiHealthDisplayCtrl to your PlayGui.
Or you can just add this code to your PlayGui.gui before the last closing brace (};)

new GuiHealthDisplayCtrl(Health) {
profile = "GuiDefault Profile";
horizSizing = "relative";
vertSizing = "relative";
position = "591 71";
extent = "30 26";
minExtent = "8 8";
visible = "1";
helpTag = "0";
};

You can create a new profile with your favourite color/font and change in the above code.
Have fun!

#1
01/22/2002 (12:00 am)
the file wasn't found :-(

I can't get the zip file
#2
01/22/2002 (7:18 am)
it works now...
sorry not my fault... GG's fault :)
#3
01/22/2002 (11:14 am)
Oki thx, now it work's
#4
11/25/2003 (10:02 pm)
AssertFatal( bool( mFont ), "GuiHealthDisplayCtrl::onWake: invalid font in profile" ); - in the guiHealthDisplayCtrl.cc line 59 needs to be changed to

AssertFatal(mFont, "GuiHealthDisplayCtrl::onWake: invalid font in profile" );
#5
05/29/2006 (1:41 am)
Warning: (c:\torque\sdk\engine\console\consoleobject.cc @ 62) Couldn't find class rep for dynamic class: HealthDisplayCtrl
starter.fps/client/ui/PlayGui.gui (0): Unable to instantiate non-conobject class HealthDisplayCtrl.


anyone know why....
#6
01/10/2007 (10:25 pm)
This doesn't work on a dedicated network.