Friday, July 27, 2007

See Invisible Bullets and Actual Colors on Radar

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" at the blog Cheating BZFlag as well as the update comment to the post, "HOWTO: See Invisible Bullets and Actual Colors on Radar".

As always...

Have fun!

No comments: