Saturday, July 28, 2007

Flag Coloring and Identify

By: Phasmophage (me)
I first read up about Flag Coloring on BZWiki and thought it was a great idea. It is a simple cheat that allows you to mark special flags (Like Laser, GM, SW, etc) with a special color. The coloring allows you to spot a special flag from a distance, and it is even colored on the radar. Imagine always being able to get a guided missile, laser, shock wave, geno, or any flag you want.
Are you drooling yet? I know I would be.
So, this edit lies in the file Flag.cxx where we will find these lines of code:

const float* FlagType::getColor() const
{
if (flagTeam == NoTeam)
return superColor;
else
return Team::getTankColor(flagTeam);
}

We will basically replace the above lines of code with the following:

const float* FlagType::getColor() const
{
static const float superColor[3] = { 1.0, 1.0, 1.0 };
static const float LaserColor[3] = { 0.8, 0.2, 0.0 };
static const float ShockColor[3] = { 0.0, 0.5, 0.5 };
static const float GuideColor[3] = { 0.5, 0.5, 0.0 };
static const float GenoCColor[3] = { 0.2, 0.8, 0.2 };
static const float BadFlColor[3] = { 0.0, 0.0, 0.0 };
if(this==Flags::Laser)return LaserColor;
else if(this==Flags::ShockWave)return ShockColor;
else if(this==Flags::GuidedMissile)return GuideColor;
else if(this==Flags::Genocide)return GenoCColor;
else if(endurance==FlagSticky)return BadFlColor;
else if (flagTeam == NoTeam)
return superColor;
else
return Team::getTankColor(flagTeam);
}

This colors laser flags red, SW blue, GM yellow, Geno green, and bad flags black. You can also change the colors, or add more flags if you like.

To identify flags we haven't colored, we will switch identify to be permanently on. To do this, open the file playing.cxx and find these lines of code:

else if (flagd == Flags::Identify) {
// identify closest flag

and oh-so-simply replace it with this:

if (1 || flagd == Flags::Identify) {
// identify closest flag

Note: Many servers have caught on to this cheat, and have disguised all flags as Phantom Zone. But then again, some haven't, and these cheats are insanely handy. Not to mention, they are pretty subtle.
If you like this cheat, want to critique it, or if these cheats have saved your marriage, leave a comment!

Have fun with this one.
-Phaz

6 comments:

bz said...

how do you use proxy in bzflag?

phasmophage said...

As far as I know, there is no built-in way to configure proxies in BZFlag. You will have to use third-party software. I'm not exactly sure but things like Private Proxy or Tor. If you're looking to mask your IP, maybe you could wardrive and use other peoples' connections. Sorry, this doesn't really answer your question, does it?

axl rose said...

http://www.geocities.com/bzflagaxlrose/

randomdude said...

:(, this cheat doesn't work for me. It only is coloured on my mousebox when i pick the flag up, otherwise it doesn't colour.

Could it be because i am using 2.0.9? I have noticed the code is a little different..

randomdude said...

ah, never mind, that was just the new servers. the old ones work perfectly with flag colouring.

phasmophage said...

Yeah, most new servers employ the Phantom Zone spoof, which hides the flagtype from clients (disguising all of them as PZ) until the flag is being used by a player.
Flag coloring is good on old servers, and several of LouMan's maps. (Man those are some cool maps.)
Some servers keep certain flags at certain areas. One good cheat could be to remotely grab flags in certain areas. You can use the server->sendGrabFlag function to remotely grab flags. The only problem is that if you're on the ground, the server detects that you're too far from a flag, but it won't autokick you. You usually have to use sendGrabFlag in the air.