Game Development Community

removing "visitor" label

by Roger D Vargas · in Torque 3D Beginner · 05/20/2014 (8:11 am) · 6 replies

How can I remove that label on top of the player mesh, or replace it with some other text displayed whenever I want (like on mouse hover or some random time) and not all the time?

#1
05/20/2014 (8:31 am)
If you look in your playGui you will see an element: GuiShapeNameHud. This is the element that displays names over shapes such as players. If you remove it from the GUI you will no longer see those names/labels.

I've modified it a few times now it's pretty simple control. It just goes through the list of clients, and checks if each one is visible. If it is, it draws the name above it. So, it's quite simple to modify it to add your own conditions.
#2
05/20/2014 (2:09 pm)
So you can change the text above an object by setting %obj.name (or calling .setName IIRC). I think the UAISK uses this for debugging, if I wasn't just imagining it.
#3
05/20/2014 (4:38 pm)
Yeah - it's normally set to your player name (selected in JoinServerDlg). It defaults to "Visitor".
core\scripts\client\defaults.cs(28):   $pref::Player::Name = "Visitor";
scripts\client\prefs.cs(32):   $pref::Player::Name = "Visitor";
Change it in both places and you'll change the default.
#4
06/15/2014 (4:53 am)
it makes you wonder why so many things are repeated in core/scripts and then again in scripts....???
#5
06/15/2014 (4:22 pm)
I'm guessing it's because they're "necessary" but meant to be overridden. I could be wrong....
#6
06/15/2014 (8:58 pm)
Defaults are just that, whereas the prefs.cs contains the values as saved by the engine...

If you decrease the size of the GuiShapeNameHud you can narrow the focus of when to display the label.