Friday, April 27, 2007

HOWTO: Seeing STEALTH Tanks on Radar

Have you enjoyed the Classic God Mode modification, yet? In case you haven't had a chance to try it out, read further down this blog to the previous HOWTO edition. If "god mode" isn't your thing, then you might find being able to see Stealth tanks on radar to be quite handy. Remember to keep it subtle; don't make yourself obvious. For example, if a Stealth tank is on the other side of a large wall, most players (particularly, the Stealth player) will know that you don't "coincidentally" shoot Super Bullets straight down the direction to the Stealth tank. Remember to pretend to be "surprised" when Stealth tank comes into view before you blow him up to kingdom come.

Being able to see stealth on your radar is very easy in and of itself. In fact, it doesn't require any additional lines of code. More elaborate adaptations of this modification, such as stealth blinking on radar, will in fact require some code; however, we're just going to stick to the simple trick for the purpose of this blog entry. We'll come back to it in more detail with various options including blinking on radar, toggle mode (to turn on/off being able to see stealth), selective stealth radar mode (in case you want to target only specifically annoying players), and so on. So, stay tuned for more later on.

After you unpack the source tarball, you will find the file "RadarRenderer.cxx" in the extracted "/bzflag-2.0.X/src/bzflag/" directory (where "X" is version number such as in version 2.0.8). Use your favorite text editor to open "RadarRenderer.cxx" and use your Find feature (e.g., ctrl+f in some graphic editors) to search for "stealth". You will come across some lines that look like this:

}
if (!player->isAlive() &&

(!useTankModels || !observer || !player->isExploding())) {

continue;

}

if ((player->getFlag() == Flags::Stealth) &&

(myTank->getFlag() != Flags::Seer)) {

continue;

}


const float* position = player->getPosition();

All we need to do is remove the portion that indicates that we should not be able to see Stealth if we don't have the Seer flag. When you are finished, the revised lines should look like this:

}
if (!player->isAlive() &&

(!useTankModels || !observer || !player->isExploding())) {

continue;

}

const float* position = player->getPosition();

Save the file, compile you client, and...

Have fun!

Related post:
HOWTO: Seeing Cloaked Tanks

0 Comments:

Post a Comment

<< Home