Player names.
by Braveheart · in Torque Game Engine · 12/12/2007 (10:05 pm) · 1 replies
Hello, is it possible at all to change the colour of certain player's names?
Also is it possible to edit the distance that you can see a player's name?
What about seeing a player's name through objects, is that changeable?
Also is it possible to edit the distance that you can see a player's name?
What about seeing a player's name through objects, is that changeable?
About the author
Torque Owner Henry Todd
Atomic Walrus
About line 193:
replace visDistanceSqr with whatever range you want.
Down around 205, this code appears:
// Test to see if it's behind something, and we want to // ignore anything it's mounted on when we run the LOS. RayInfo info; shape->disableCollision(); ShapeBase *mount = shape->getObjectMount(); if (mount) mount->disableCollision(); bool los = !gClientContainer.castRay(camPos, shapePos,losMask, &info); shape->enableCollision(); if (mount) mount->enableCollision(); if (!los) continue;You can comment this whole section out, or just the if (!los) continue; bit at the end, and names will show through objects.Down at line 264 the color gets set:
Again, replace as desired. In this function you only have access to the Player's name, not their object *, so you might consider moving this call to the previous function (onRender) if you need to access variables from the player object. If you just want to check for specific names and pick colors based on them, you can do that in drawName.