the cc code where this is contro"> Crosshairs / First Person | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Crosshairs / First Person

by Quest Johnny · in Torque Game Engine · 03/04/2004 (11:10 am) · 8 replies

As a little exercise, I'm trying to make the crosshairs visible in "chase" camera mode (when you press tab) but the crosshairs is not visible and I can't seem to make it.. nor can I seem to find the spot in the script the cc code where this is controlled.. Does anybody know where I look to find the code that governs the client's GUI display?

#1
03/04/2004 (12:32 pm)
Fps/game/guiCrosshairHud.cc

Function:
GuiCrossHairHud::onRender

Make:
if (!control || !(control->getType() & ObjectMask) || !conn->isFirstPerson())

Into:
if (!control || !(control->getType() & ObjectMask))

If we are not in first person view it will return the function, this will keep the function alive even if we are in 3rd person.
#2
03/04/2004 (6:07 pm)
Ye gods - you mean, to change the way the hud is displayed you have to go into the C code? You can't do it in script?
#3
03/05/2004 (10:13 am)
Yes, because if it was in script and having a cross hair in 3rd person was a good way to cheat, then it would be very easy for people to cheat, eh...
#4
03/06/2004 (10:07 pm)
Of course, this particular 'cheat' has a easier, low tech solution. Cellophane tape and a marker. And you can add range adjustment marks to the tape.

enjoy
scott
#5
03/07/2004 (5:42 am)
Roflmao
#6
03/07/2004 (6:19 am)
Ya, I'm not sure that's much of an explanation as to why. Seems the crosshair is part fo the gui and the gui scriptable...
#7
03/07/2004 (6:30 am)
Well, you could always remove the guiCrossHair hud control and simply put a cross hair bitmap in there instead. then you can do it in script :)
#8
03/07/2004 (7:40 am)
Ohh yes? Hmm.. THAT's an idea :)

THANKS PHIL that worked a treat.. Alas, I'm really new at all the ins and outs so these SIMPLE answers just don't occur to me. I resist changing the code at this early stage.

BTW, how come when I move the blue "energy" meter all the way to the right in the GUI editor it's only partially to the right in play?