Sunday, July 22, 2007

HOWTO: See Invisible Bullets and Actual Colors on Radar

Brought to you by Phasmophage :)

You may recall our previous post about being able to see Stealth tanks on radar. That's useful, we can do more to make ouur radar even more powerful. With this tip from Phasmophage, we can add the ability to see Invisible Bullets and see the actual tank colors of tanks when we have the Colorblindness flag.

For this, we're revisiting RadarRenderer.cxx in /src/bzflag/ of the extracted source. Search for " if (shot && (shot->getFlag() !=" and you will find this line:

if (shot && (shot->getFlag() != Flags::InvisibleBullet || iSeeAll)) {

Remove "&& (shot->getFlag() != Flags::InvisibleBullet || iSeeAll)" so that the edited line looks like this:

if (shot) {

Look at this entire section now (includes edited line from above):

if (shot) {
const float *shotcolor;
if (coloredShot) {
if (myTank->getFlag() == Flags::Colorblindness)
shotcolor = Team::getRadarColor(RogueTeam,rabbitMode);
else
shotcolor = Team::getRadarColor(player->getTeam(),rabbitMode);
const float cs = colorScale(shot->getPosition()[2], muzzleHeight);

Notice the fourth line in particular:

if (myTank->getFlag() == Flags::Colorblindness)

Let's remove the "== Flags::Colorblindness" so that the line now reads like this:

if (myTank->getFlag())

Next, remove this line:

shotcolor = Team::getRadarColor(RogueTeam,rabbitMode);

... and this:

else

... so that the modified section should now read like this:

if (shot) {
const float *shotcolor;
if (coloredShot) {
if (myTank->getFlag())
shotcolor = Team::getRadarColor(player->getTeam(),rabbitMode);
const float cs = colorScale(shot->getPosition()[2], muzzleHeight);

Save the file, compile your client, and you're done! To view Phasmophage's original instructions, take a look at his comment to "HOWTO: Reverse While Sealed with Oscillation Overthruster" as well as the update comment to this post, "HOWTO: See Invisible Bullets and Actual Colors on Radar".

As always...

Have fun!

Related posts:
HOWTO: Seeing STEALTH Tanks on Radar
HOWTO: Always See Actual Tank Colors

9 Comments:

Blogger phasmophage said...

Oops. I might have made a mistake. The edited lines at the end of the instruction should not be the following:


if (shot) {
const float cs = colorScale(shot->getPosition()[2], muzzleHeight);

I think it should be:
if (shot) {
const float *shotcolor = Team::getRadarColor(player->getTeam(),rabbitMode);
const float cs = colorScale(shot->getPosition()[2], muzzleHeight);

This extra line is necessary if coloring shots.
-phasmophage
(aka "Phaz")

7/22/2007 9:50 AM  
Blogger CRW said...

phasmophage, I tried that edit and had some compile errors. I adjusted the new correction slightly, and this seems to work. If you get a chance, try it out and see if it works at your end as well.

7/22/2007 2:20 PM  
Blogger phasmophage said...

Oh yeah. I guess you're right. Usually when I do cheat edits, I do it a little bit differently than what I post in order to enable a toggle function. If you say that way works, it's fine with me!
Thanks for the corrections.
-phasmophage
(aka "phaz")

7/22/2007 5:00 PM  
Blogger CRW said...

Roger that, phasmophage! Again, thanks for sharing, and your tips are welcome here any time :)

7/22/2007 10:48 PM  
Blogger phasmophage said...

Finally! My newest release! I have found out how to get radar on non-radar maps. In RadarRenderer.cxx find

void RadarRenderer::render(SceneRenderer& renderer, bool blank, bool observer)
{
RenderNode::resetTriangleCount();
const float radarlimit = (Something, I can't remember.)

And change the entire thing to:


void RadarRenderer::render(SceneRenderer& renderer, bool blank, bool observer)
{
RenderNode::resetTriangleCount();
float test = BZDBCache::radarLimit;
if(test<=0.0)
{
test = BZDB.eval(StateDatabase::BZDB_WORLDSIZE);
BZDB.setFloat(StateDatabase::BZDB_RADARLIMIT, BZDB.eval(StateDatabase::BZDB_WORLDSIZE));
}
const float radarLimit = test;

On maps with no radar, the radar limit is set to 0 or a negative number. This will fix it to the correct number, the size of the world. So now no more hide and seek!
(Sorry my post is short, and not grammar checked.)
-phasmophage
(aka "Phaz")

7/25/2007 8:11 PM  
Blogger sk3 said...

This comment has been removed by the author.

10/20/2010 4:11 PM  
Blogger sk3 said...

This comment has been removed by the author.

10/20/2010 4:13 PM  
Blogger sk3 said...

This comment has been removed by the author.

10/20/2010 4:17 PM  
Blogger sk3 said...

Hey, because this blog isn't that active anymore i created a new one on my own.

Hopefully there will be more activity.
Here is the link:

bzhacks.blogspot.com

Anyone

10/20/2010 4:18 PM  

Post a Comment

<< Home