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

Instant Self Destruct

By: Phasmophage
So, you're in a corner and a guy is about to shoot you. Or maybe he's locked on to you with Guided Missile. Maybe your in range of a Shock Wave. Either way, this guy's about to kill you, and you know it. So here's a great way to kill yourself instantly and not give that little punk the point, (and totally piss him off while your at it): Instant Self Destruct!

This is a really simple edit, so open up playing.cxx and find these lines:

if (destructCountdown > 0.0f) {
const int oldDestructCountdown = (int)(destructCountdown + 0.99f);
destructCountdown -= dt;
if (destructCountdown <= 0.0f) {
// now actually destruct

Edit it so it looks like this:

if (destructCountdown > 0.0f) {
const int oldDestructCountdown = (int)(destructCountdown + 0.99f);
destructCountdown -= dt;
if (1 || destructCountdown <= 0.0f) { destructCountdown = 0.0f; // now actually destruct

And now you can die with dignity!
Alright, so this is one of my more stupid "cheats" but it still has its advantage.
Enjoy it!
-Phaz


Ultimate Pausing

By: Phasmophage

Alright now, this is my first real post as a contributor.

Anyhoo, most of you know that it takes five seconds to pause, and you have to be on the ground or on a building, or else your pause will cancel. Also, after you pause your radar and your HUD (Heads Up Display) go completely blank, not to mention you have no sound. This leaves you vulnerable to being shot by some dude that has been waiting right behind you. Well, no more! With this cheat, you will be able to pause anywhere instantly, and be able to see what's around you. (And it's also really funny to pause in the air right in front of somebody, they'll be thinking "Why is that dude frozen in the air with a bubble around him?")

First, you'll need to open clientCommands.cxx and find these lines:


} else if (myTank->getLocation() == LocalPlayer::InBuilding) {
// custom message when trying to pause while in a building
// (could get stuck on un-pause if flag is taken)
hud->setAlert(1, "Can't pause while inside a building", 1.0f, false);

} else if (myTank->getLocation() == LocalPlayer::InAir) {
// custom message when trying to pause when jumping/falling
hud->setAlert(1, "Can't pause when you are in the air", 1.0f, false);

} else if (myTank->getLocation() != LocalPlayer::OnGround &&
myTank->getLocation() != LocalPlayer::OnBuilding) {
// catch-all message when trying to pause when you should not
hud->setAlert(1, "Unable to pause right now", 1.0f, false);

What these lines do is make sure you're in a valid spot to begin the pause countdown. We don't want that, so what you should do is put a "0 &&" to skip checking, so your code looks like this:

} else if (0 && myTank->getLocation() == LocalPlayer::InBuilding) {
// custom message when trying to pause while in a building
// (could get stuck on un-pause if flag is taken)
hud->setAlert(1, "Can't pause while inside a building", 1.0f, false);

} else if (0 && myTank->getLocation() == LocalPlayer::InAir) {
// custom message when trying to pause when jumping/falling
hud->setAlert(1, "Can't pause when you are in the air", 1.0f, false);

} else if (0 &&amp; myTank->getLocation() != LocalPlayer::OnGround &&
myTank->getLocation() != LocalPlayer::OnBuilding) {
// catch-all message when trying to pause when you should not
hud->setAlert(1, "Unable to pause right now", 1.0f, false);

Now we will make edits to LocalPlayer.cxx

Find these lines:
// if paused then boost the reload times by dt (so that, effectively,
// reloading isn't performed)
int i;
if (isPaused()) {
for (i = 0; i <>
if (shots[i]) {
shots[i]->boostReloadTime(dt);
}
}

and add a "0 &&" before the isPaused() so the line looks like this:

if (0 && isPaused()) {

This allows you to reload while paused.

Now we need to make edits in playing.cxx

Find these lines in the updatePauseCountdown function:

if (pauseCountdown <= 0.0f) {
pauseCountdown = 0.0f;

We will change this to:

if (1 || pauseCountdown <= 0.0f) {
pauseCountdown = 0.0f;

Below these lines you will find some code similar to the ones we edited in clientCommands.cxx:

if (myTank->getLocation() == LocalPlayer::InBuilding) {
// custom message when trying to pause while in a building
// (could get stuck on un-pause if flag is taken/lost)
hud->setAlert(1, "Can't pause while inside a building", 1.0f, false);

} else if (myTank->getLocation() == LocalPlayer::InAir) {
// custom message when trying to pause when jumping/falling
hud->setAlert(1, "Can't pause when you are in the air", 1.0f, false);

} else if (myTank->getLocation() != LocalPlayer::OnGround &&
myTank->getLocation() != LocalPlayer::OnBuilding) {
// catch-all message when trying to pause when you should not
hud->setAlert(1, "Unable to pause right now", 1.0f, false);

} else if (myTank->isPhantomZoned() ) {
// custom message when trying to pause while zoned
hud->setAlert(1, "Can't pause when you are in the phantom zone", 1.0f, false);

after all the "if(" parts we will add "0 && " to skip the checks. (WARNING: Make sure you don't pause in a building with OO or PZ because you will lose the flag, and you may be stuck. Make sure you have the proper cheats to get out of it.) The edited code should look like this:


if (0 && myTank->getLocation() == LocalPlayer::InBuilding) {
// custom message when trying to pause while in a building
// (could get stuck on un-pause if flag is taken/lost)
hud->setAlert(1, "Can't pause while inside a building", 1.0f, false);

} else if (0 && myTank->getLocation() == LocalPlayer::InAir) {
// custom message when trying to pause when jumping/falling
hud->setAlert(1, "Can't pause when you are in the air", 1.0f, false);

} else if (0 &&amp; myTank->getLocation() != LocalPlayer::OnGround &&
myTank->getLocation() != LocalPlayer::OnBuilding) {
// catch-all message when trying to pause when you should not
hud->setAlert(1, "Unable to pause right now", 1.0f, false);

} else if (0 && myTank->isPhantomZoned() ) {
// custom message when trying to pause while zoned
hud->setAlert(1, "Can't pause when you are in the phantom zone", 1.0f, false);

You'll also find these lines, which turn off the sound:

// turn off the sound
if (savedVolume == -1) {
savedVolume = getSoundVolume();
setSoundVolume(0);
}

You can basically delete it or comment it out so it looks like this:
// turn off the sound
/*if (savedVolume == -1) {
savedVolume = getSoundVolume();
setSoundVolume(0);
}*/

Now, to see the radar while paused, find these lines:

if (radar) {
const bool showBlankRadar = !myTank || (myTank && myTank->isPaused());
const bool observer = myTank && (myTank->getTeam() == ObserverTeam);
radar->render(*sceneRenderer, showBlankRadar, observer);
}

And edit the second line so it looks like this:
const bool showBlankRadar = !myTank;

Finally, to see out the HUD while paused, find these lines:
// turn blanking and inversion on/off as appropriate
sceneRenderer->setBlank(myTank && (myTank->isPaused() ||
myTank->getFlag() == Flags::Blindness));

And you can delete it or comment it out, so it looks like this:
// turn blanking and inversion on/off as appropriate
// sceneRenderer->setBlank(myTank && (myTank->isPaused() ||
// myTank->getFlag() == Flags::Blindness));

And this should let you pause anywhere instantly and see out the radar, the HUD, hear sounds while paused.

Tell me what you think,
-Phaz
Have fun!

Friday, July 27, 2007

View Radar on Maps without Radar

By: Phasmophage (aka "Phaz")

Here's a sweet little number that you won't want to pass up... How would you like radar on those maps without radar? Now you can have an advantage over with tanks by having access to your radar on maps that don't allow it! As Phaz tells us:

"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!"

For this, we visit RadarRenderer.cxx in /src/bzflag/ of the extracted source. Start by searching for "void RadarRenderer::render(SceneRenderer&" and you will come to this section:

void RadarRenderer::render(SceneRenderer& renderer, bool blank, bool observer)
{
RenderNode::resetTriangleCount();

const float radarLimit = BZDBCache::radarLimit;
if (!BZDB.isTrue("displayRadar") || (radarLimit <= 0.0f)) {
triangleCount = 0;
return;

First, look at this line from above:

const float radarLimit = BZDBCache::radarLimit;

Change that line to this:

float test = BZDBCache::radarLimit;

Below that, you will see this line:

if (!BZDB.isTrue("displayRadar") || (radarLimit <= 0.0f)) {

Change that line to this:

if(test<=0.0) {

Next, you will see this line:

triangleCount = 0;

Change that line to this:

test = BZDB.eval(StateDatabase::BZDB_WORLDSIZE);

The next line you see is this:

return;

Change it to this (all one, single line):

BZDB.setFloat(StateDatabase::BZDB_RADARLIMIT, BZDB.eval(StateDatabase::BZDB_WORLDSIZE));

On the next line, you will see this:

}

Directly below the "}" (vertically aligned), add this line:

const float radarLimit = test;

So that the two lines together look like this:

}
const float radarLimit = test;

The entire edit should like this:

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;
// render the frame

Save the file, compile your client, and you're done. To view Phasmophage's original instructions, read his comment to "HOWTO: See Invisible Bullets and Actual Colors on Radar" at the blog Cheating BZFlag.

As always...

Have fun!

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!

Always See Actual Tank Colors

By: Phasmophage

Here's an edit that will allow you to see the actual tank color of players even if they have Masquerade and/or if you have Colorblindness. For this, we will go to playing.cxx in /src/bzflag/ of the extracted source. Search for "const bool colorblind = (myTank->getFlag()", and you will come to this section:

const bool colorblind = (myTank->getFlag() == Flags::Colorblindness);
player[i]->addShots(scene, colorblind);

TeamColor effectiveTeam = RogueTeam;
if (!colorblind){
if ((player[i]->getFlag() == Flags::Masquerade)
&& (myTank->getFlag() != Flags::Seer)
&& (myTank->getTeam() != ObserverTeam)) {
effectiveTeam = myTank->getTeam();
}
else {
effectiveTeam = player[i]->getTeam();
}
}

const bool inCockpt = ROAM.isRoaming() && !devDriving &&

Look at the first line. Replace "(myTank->getFlag() == Flags::Colorblindness);
player[i]->addShots(scene, colorblind)" with "false" so that the edited line looks like this:

const bool colorblind = false;

Next, look at the line "TeamColor effectiveTeam = RogueTeam;". Replace "RogueTeam" with "player[i]->getTeam()" so that the edited line looks like this:

TeamColor effectiveTeam = player[i]->getTeam();

Remove the lines between the line above and "const bool inCockpt = ROAM.isRoaming() && !devDriving &&" so that the section will look like this:

TeamColor effectiveTeam = player[i]->getTeam();

const bool inCockpt = ROAM.isRoaming() && !devDriving &&

The entire edited section should now look like this:

const bool colorblind = false;
player[i]->addShots(scene, colorblind);

TeamColor effectiveTeam = player[i]->getTeam();

const bool inCockpt = ROAM.isRoaming() && !devDriving &&

As Phasmophage said it, "This should color masqueraded tanks correctly, and take out some of the effects of colorblindness."

Save the file, compile your new client, and you're done. To view Phasmophage's original instructions, read his comment to "HOWTO: Reverse While Sealed with Oscillation Overthruster" from the blog Cheating BZFlag.

And,...

Have fun!

Reverse While Sealed with Oscillation Overthruster

By: Phaz

Tired of not being able to reverse into a building with your Oscillation Overthruster (OO) flag? If you poke out of a building to take a shot, can only back into the building by jumping backward which leaves you vulnerable. Or, let's say that you are sealed in a thin wall. If you want to backtrack, you will have to leave the safety of the building to turn around.

No longer!

Thanks to this tip from Phaz, you can back up while sealed with OO! Now you can pull out, snipe your shot, and simply back up into the safety of the building (or other obstacle where you can be sealed). That is, you are no longer limited to driving only in the forward direction.

For this edit, we are going to open LocalPlayer.cxx in /src/bzflag/ of the extracted source. First let's edit the sections that prevent us from being able to back up while sealed. Search for "if (expelled && phased)", and you will this section:

if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
obstacle->getType() == Teleporter::getClassName() ||
(getFlag() == Flags::OscillationOverthruster && desiredSpeed < 0.0f &&
p[2] == 0.0f));
return obstacle;

Remove The following from above:
                                                                
||
(getFlag() == Flags::OscillationOverthruster && desiredSpeed < 0.0f &&
p[2] == 0.0f));

The section should now read like this:

if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
obstacle->getType() == Teleporter::getClassName());
return obstacle;

Next, search for "if (expelled && phased)" again, and you will find this section:

if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
obstacle->getType() == Teleporter::getClassName() ||
(hasOOflag && desiredSpeed < 0.0f && p[2] == 0.0f));

if (obstacle != NULL) {

Remove the following from above:

||
(hasOOflag && desiredSpeed < 0.0f && p[2] == 0.0f));

The section should now read like this:

if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
obstacle->getType() == Teleporter::getClassName());

if (obstacle != NULL) {

Lastly, search for "oscillation overthruster tank in building can't" and you will find this section:

else if (fracOfMaxSpeed < -0.5f) fracOfMaxSpeed = -0.5f;

// oscillation overthruster tank in building can't back up
if (fracOfMaxSpeed < 0.0f && getLocation() == InBuilding &&
flag == Flags::OscillationOverthruster) {
fracOfMaxSpeed = 0.0f;
}

// boost speed for certain flags

Let's remove the portion about not being able to back up in a building so that the edited section now reads like this:

else if (fracOfMaxSpeed < -0.5f) fracOfMaxSpeed = -0.5f;

// boost speed for certain flags

Save the file, compile your new client, and you're done! For Phaz's original instructions, see his comment to "HOWTO: Drop Bad Flags Instantly"at Cheating BZFlag.

Keep these tips rolling in! And as always...

Have fun!

Respawn Instantly

Brought to you by blogger, Someone

Someone actually brought this to us a while back, and I apologize for taking so long to post it. Anyway, here's a tip that will allow you to respawn instantly after exploding. In LocalPlayer.cxx (in /src/bzflag/ of the extracted source), search for "else if (location == Exploding)" and you will find this section:

} else if (location == Exploding) {
// see if explosing time has expired
if (lastTime - getExplodeTime() >= BZDB.eval(StateDatabase::BZDB_EXPLODETIME)) {
dt -= float((lastTime - getExplodeTime()) - BZDB.eval(StateDatabase::BZDB_EXPLODETIME));
if (dt < 0.0f) {
dt = 0.0f;
}
setStatus(PlayerState::DeadStatus);
location = Dead;
if (isAutoPilot()) {
CMDMGR.run("restart");
}
}

// can't control explosion motion
newVelocity[2] += BZDBCache::gravity * dt;
newAngVel = 0.0f; // or oldAngVel to spin while exploding
} else if ((location == OnGround) || (location == OnBuilding) ||

First, let's look at the first through tenth lines from above:

} else if (location == Exploding) {
// see if explosing time has expired
if (lastTime - getExplodeTime() >= BZDB.eval(StateDatabase::BZDB_EXPLODETIME)) {
dt -= float((lastTime - getExplodeTime()) - BZDB.eval(StateDatabase::BZDB_EXPLODETIME));
if (dt < 0.0f) {
dt = 0.0f;
}
setStatus(PlayerState::DeadStatus);

Let's remove the second through seventh lines so that it now reads like this:

} else if (location == Exploding) {
setStatus(PlayerState::DeadStatus);

Next, notice this section:

setStatus(PlayerState::DeadStatus);
location = Dead;
if (isAutoPilot()) {
CMDMGR.run("restart");

Let's remove "location = Dead;" and "if (isAutoPilot()) {". Below the line "location = Dead;", add the following:

LocalPlayer *myTank = LocalPlayer::getMyTank();

Below that line, add this line:

myTank->setJumpPressed(false);

The above edits should now read like this:

setStatus(PlayerState::DeadStatus);
LocalPlayer *myTank = LocalPlayer::getMyTank();
myTank->setJumpPressed(false);
CMDMGR.run("restart");

Next, notice this section:

CMDMGR.run("restart");
}
}

// can't control explosion motion
newVelocity[2] += BZDBCache::gravity * dt;
newAngVel = 0.0f; // or oldAngVel to spin while exploding
} else if ((location == OnGround) || (location == OnBuilding) ||

Let's remove the lines between "CMDMGR.run("restart");" and " } else if ((location == OnGround) || (location == OnBuilding) ||" so that the section now reads like this:

CMDMGR.run("restart");
} else if ((location == OnGround) || (location == OnBuilding) ||

All of the above edits should now look like this:

} else if (location == Exploding) {
setStatus(PlayerState::DeadStatus);
LocalPlayer *myTank = LocalPlayer::getMyTank();
myTank->setJumpPressed(false);
CMDMGR.run("restart");
} else if ((location == OnGround) || (location == OnBuilding) ||

When you are finished, compile your client and you're done. To view Someone's original instructions, read his comment to "HOWTO: Drop Bad Flags Instantly" at the original blog, Cheating BZFlag.

As always...

Have fun!

Drop Bad Flags Like Regular Flags

By: Phaz

You may recall our earlier post about how to how to drop bad flags instantly. With that edit, you drop a bad flag as soon as you pick it up. You may not always want to do that especially on servers that do not allow players to drop bad flags since you may bring suspicion to yourself.

TIP: If you are not interested in cheating... On servers where dropping bad flags is not allowed, you can usually take advantage of the drop flag after pausing feature of BZFlag to drop your bad flag. Simply pause, and your flag will drop after a few seconds.

As an alternative to dropping bad flags instantly, Phaz has a simple edit for us that will allow a player to drop a bad flag like a regular flag. For this, we are going to edit clientCommands.cxx in /src/bzflag of the extracted source. Search for "flag->endurance != FlagSticky" and you will find this section:

if ((flag != Flags::Null) && !myTank->isPaused() &&
(flag->endurance != FlagSticky) && !myTank->isPhantomZoned() &&
!(flag == Flags::OscillationOverthruster &&
myTank->getLocation() == LocalPlayer::InBuilding)) {
serverLink->sendDropFlag(myTank->getPosition());

In particular, notice the second line:

(flag->endurance != FlagSticky) && !myTank->isPhantomZoned() &&

Remove "(flag->endurance != FlagSticky) &&" so that the line now reads like this:

!myTank->isPhantomZoned() &&

Save the file, compile the client, and you're done! To see Phaz's original instructions, read his comment to HOWTO: Drop Bad Flags Instantly at Cheating BZFlag. As always...

Have fun!

Drop Bad Flags Instantly

By: Lord Jesus

Bad flags are annoying, are they not? This is especially true in situations such as grabbing Jamming when your opponent has Cloaking. And those time limits! On servers with bad flag drop such as 15 seconds or more, waiting can be ever so dull. Wide Angle isn't so awfully bad if you get used being able to utilize it; but, let's face it; there are certainly other more desirable flags.

Here's an edit that will allow you to drop bad flags instantly even on servers that do not allow dropping of bad flags (an added bonus). Most players probably won't notice; however, there is a chance that the more experienced players might very well notice -- even if after a while -- as well as administrators especially if they're already monitoring you out of suspicion.

Open LocalPlayer.cxx in the /src/bzflag/ directory of the extracted source, and find the following lines:

// drop bad flag if timeout has expired
if (!isPaused() && dt > 0.0f && World::getWorld()->allowShakeTimeout() &&
getFlag() != Flags::Null && getFlag()->endurance == FlagSticky &&
flagShakingTime > 0.0f) {
flagShakingTime -= dt;
if (flagShakingTime <= 0.0f) {
flagShakingTime = 0.0f;
server->sendDropFlag(getPosition());

First, look at the second line:

if (!isPaused() && dt > 0.0f && World::getWorld()->allowShakeTimeout() &&

Let's remove "World::getWorld()->allowShakeTimeout() &&" so that it reads like this:

if (!isPaused() && dt > 0.0f &&

Next, let's look at the fifth line:

flagShakingTime -= dt;

Let's change "-= dt" to "= 0.0f" so that the line reads like this:

flagShakingTime = 0.0f;

The above will allow you to drop bad flags instantly on servers that allow for dropping of bad flags. To be able to drop flags on servers that don't allow dropping, we need to edit elsewhere. Take note, however, that experienced players will most likely notice your dropping bad flags if you are playing on a server that doesn't allow it. To add the ability, find the following lines:

// if it's bad then reset countdowns and set antidote flag
if (getFlag() != Flags::Null && getFlag()->endurance == FlagSticky) {
if (World::getWorld()->allowShakeTimeout())
flagShakingTime = World::getWorld()->getFlagShakeTimeout();

Look at the third line:

if (World::getWorld()->allowShakeTimeout())

Remove "->allowShakeTimeout()" so that it reads like this:

if (World::getWorld())

Next, let's look at the fourth line:

flagShakingTime = World::getWorld()->getFlagShakeTimeout();

Replace "= World::getWorld()->getFlagShakeTimeout();" with "= 0.05f;" so that it reads like this:

flagShakingTime = 0.05f;

I originally tried the number to "0.0f". When I tested it on my server not allowing bad flag dropping, and no win limit, it didn't work; I picked up a bad flag and it didn't drop. So, 0.05f "works". All of this tip works even if there are easier and/or more efficient ways of accomplishing the same ends :)

When you're finished, save your file, compile your new client, and...

Have fun!

Speed Hacking

Brought to you by: Felipe

Here are some tips that will allow you to get the most of your tank's speed without having to depend on the high speed flag. You can optionally add quick turn to your tank, as well. Even without extreme speed, and handful of servers may kick you. Most won't at the time of this post. A few more servers may kick you for extreme speed. Nevertheless, you will enjoy always being able to chase down other tanks...

Open LocalPlayer.cxx in /src/bzflag/ of the extracted source. With your favorite text editor, find the following lines:

// boost speed for certain flags
if (flag == Flags::Velocity) {
fracOfMaxSpeed *= BZDB.eval(StateDatabase::BZDB_VELOCITYAD);

Look at the first line. Remove the "== Flags::Velocity" so that this section reads like this:

// boost speed for certain flags
if (flag) {
fracOfMaxSpeed *= BZDB.eval(StateDatabase::BZDB_VELOCITYAD);

This will give you high speed regardless of flag save Thief and Burrow. Additionally, you will see further down these lines:

} else if ((flag == Flags::Burrow) && (getPosition()[2] < 0.0f)) {
fracOfMaxSpeed *= BZDB.eval(StateDatabase::BZDB_BURROWSPEEDAD);

You can change "BZDB_BURROWSPEEDAD" to "BZDB_VELOCITYAD" so that the lines read like this:

} else if ((flag == Flags::Burrow) && (getPosition()[2] < 0.0f)) {
fracOfMaxSpeed *= BZDB.eval(StateDatabase::BZDB_VELOCITYAD);

This will give you high speed with Burrow. You can also play around some of these variables. For example, I substituted "BZDB_BURROWSPEEDAD" and "BZDB_VELOCITYAD" with "BZDB_THIEFVELAD" so that I could drive at the speed of Thief on my own server. Some servers will undoubtedly kick you for driving too fast when you drive at Thief speed without Thief... but then, some won't :)

For EXTREME speed, find the following lines:

// can't go faster forward than at top speed, and backward at half speed
if (fracOfMaxSpeed > 1.0f) fracOfMaxSpeed = 1.0f;
else if (fracOfMaxSpeed < -0.5f) fracOfMaxSpeed = -0.5f;

Change the numbers so that the section now reads like this:

// can't go faster forward than at top speed, and backward at half speed
if (fracOfMaxSpeed > 0.0f) fracOfMaxSpeed = 9.0f;
else if (fracOfMaxSpeed < 0.0f) fracOfMaxSpeed = -9.0f;

Again, play around with the numbers to find a speed that you like. Naturally, you will stick out like a sore thumb when you drive so unbelievably faster than everyone else. Hehehe...

For the original instructions, see Felipe's comments to Flying Without Wings & Extended Jumping at the original Cheating BZFlag blog. When you're finished, save the file, compile your new client, and ...

Have fun!

Quick Turn Always

Brought to you by: Felipe

Here's a simple edit that will allow you to have Quick Turn at all times without the Quick Turn Flag. Find the following lines of LocalPlayer.cxx in the /src/bzflag/ directory of the extracted source:

// boost turn speed for other flags
if (flag == Flags::QuickTurn) {

Remove "== Flags::QuickTurn" so that the lines read like this:

// boost turn speed for other flags
if (flag) {

For the original instructions, see Felipe's comments to Flying Without Wings & Extended Jumping at the original Cheating BZFlag blog. When you're finished, save the file, compile your new client, and ...

Have fun!

Fly Without Wings & Improved Jumping

Brought to you by: Felipe

Scenario: You and another tank are jumping and shooting at one another. Wouldn't it be nice to be able to slide in one more jump in mid air? Now you can! You can 1-up those annoying players who keep coming at you with Wings. What's cool is that you are not limited to any number of jumps, and this can be especially useful on servers with Wings flap limits ;) But, this tip doesn't stop there...

You can jump no matter what -- regardless of whether or not the server allows jumping (the good folks at Hepcat will love you for it, hehehe...), or if you have the Burrow flag, or even if you have the No Jumping flag! When Burrowed, the jump isn't instantaneous, so you will need to press and hold jump to get airborne. And, it doesn't matter if you are sealed in a building with Oscillation Overthruster. Now, you can jump from inside a building to pick off players who think that they are safe by staying top of your building . Muwahahahaha! >:)

Not only all of that, but you can also control your tank in the air while jumping. And, you can fly regardless of what flag you have! Imagine being able to fly high to target a Winged tank with your guided missile... or shockwave in air. Or, on a CTF server with no jumping allowed, you can place your team's flag on top of a pillar since the other team won't be able to jump up to get it >:) The possibilities are practically endless... See the comments to this post to see how this was updated.

We're going back to LocalPlayer.cxx for this. You can find it in /src/bzflag/ after you have extracted the source. Use your favorite text editor's search function to locate "can't jump while burrowed". You will come across this section:

FlagType* flag = getFlag();

// can't jump while burrowed
if (getPosition()[2] < 0.0f) {
return;
}

if (flag == Flags::Wings) {
if (wingsFlapCount <= 0) {
return;
}
wingsFlapCount--;
} else if ((location != OnGround) && (location != OnBuilding)) {
// can't jump unless on the ground or a building
if (flag != Flags::Wings)
return;
if (wingsFlapCount <= 0)
return;
wingsFlapCount--;
} else if ((flag != Flags::Bouncy) &&
((flag != Flags::Jumping && !World::getWorld()->allowJumping()) ||
(flag == Flags::NoJumping))) {
return;
}

// add jump velocity (actually, set the vertical component since you

Let's do away with most of this section so that it reads like this:

FlagType* flag = getFlag();

// add jump velocity (actually, set the vertical component since you

The above allows us to jump whenever we want. Now, let's add some ability steer in air. Search for "can't control motion in air unless have wings", and you will come to a section that looks like this:

// can't control motion in air unless have wings
if (getFlag() == Flags::Wings) {
float speed = desiredSpeed;

Specifically, let's look at the second line of the above:

if (getFlag() == Flags::Wings) {

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

if (getFlag()) {

Save the file, compile your new client, and you're done. Many thanks to Felipe for sharing this one with us ;) You can view the original instructions in the comments of the Cheating BZFlag blog post, The Infamous BZFlag F5 Cheat. Please take a look at our previous posts if you haven't already done so. And, let's keep those tips rolling in >:) As always...

Have fun!

TIP: The Infamous BZFlag F5 Cheat

By: Lord Jesus

Grab yourself a copy of the 2.0.4 version of BZFlag, and use F5 -- the screenshot function -- to insert artificial lag. One method is to press and hold F5 to insert the lag. This is a great technique for dodging bullets and capturing another team's flag.

You can also press and hold F5 to get to other places you normally couldn't get to... like the other side of a wall. Again, this is if you you use the older 2.0.4 version of BZFlag. The delay for taking a screenshot until you release F5 was "fixed" in version 2.0.8. You can read about how it works in this discussion:

my.bzflag.org/bb/

"
The basic case is this: the tank moves along velocity vector, then collisions are checked. If the tank has moved too far along in one time step, it is now inside (or on the other side(the F5 cheat!)) of the object it 'collided' with." [emphasis added]

It's briefly mentioned here, too:

http://www.answers.com/topic/bzflag

"
F5: To F5 is to take a screenshot of BZFlag, which also creates a small lagspike and makes your tank unhittable for a short interval of time."

As you can imagine, this has been around for quite a while. It's posted here at BZFlag Cheat just in case you didn't get an opportunity to take advantage of it previously >:) Some more information about the F5 technique is easy to find with your favourite search engine. Here's an example:

Google search

Keep in mind that it is not entirely undetectable especially among experienced players. Use it wisely ;) Here's an example of a player, soxs, who got banned for it:

http://gu.bzleague.com/index.php?link=shame

So, now you can enjoy enhanced gaming without having to modify or add a single line of code to your client!
To control disk space, don't forget to empty your screenshots folder when you're finished playing. And as always...

Have fun!

Shoot While Sealed with Oscillation Overthruster

By: Lord Jesus

Imagine that you have Oscillation Overthruster (OO) and you're chasing another player with OO. The other player dodges you by hiding in a building or some other structure (for example, while playing Hide-N-Seek Hills). You can go after the player to maintain your chase; however, what if the player stops while you're both sealed? You can't shoot if you're both sealed. Moreover, you can almost imagine the other player saying something like, "Haha! You can't shoot me here!"

Now, you can have the last laugh as the other tank goes Kaboom! Thrills and laughs abound now that buildings are no longer safe havens for other players with OO. But, why stop there? Snipe other players from the safety of buildings...

To do that, we're going to visit LocalPlayer.cxx (in /src/bzflag/ of the extracted source).

Use the search feature of your favorite text editor and look for "case Exploding". You will come to a section like this:

case Exploding:
firingStatus = Deceased;
break;
case InBuilding:
firingStatus = (getFlag() == Flags::PhantomZone) ? Zoned : Sealed;
break;
default:
if (isPhantomZoned())

Let's do away with the "case InBuilding" section so that the modified file now looks like this:

case Exploding:
firingStatus = Deceased;
break;
default:
if (isPhantomZoned())

Next, search for "make sure we're allowed to shoot". You will come to a section that looks like this:

// make sure we're allowed to shoot
if (!isAlive() || isPaused() ||
((location == InBuilding) && !isPhantomZoned())) {
return false;
}

Let's do a quick edit so that it now looks like this:

// make sure we're allowed to shoot
if (!isAlive() || isPaused()) {
return false;
}

Note that the above edit will only allow you to be able to shoot while sealed in a building; it will not affect your shooting while Phantom Zoned.

Save your new file, and you're done. In case you haven't already checked, take a look at the previous HOWTO posts for more tips. When you're finished, compile your client and...

Have fun!

See Cloaked Tanks

By: Lord Jesus

Have you enjoyed being able to see those pesky Stealth tanks on your radar? Be sure to read the previous posts in case you've missed them :)

Anyway, here's a simple trick that will allow you to see cloaked tanks. As a note, this will not affect lasers; lasers will still pass through cloaked tanks. You will be able to see them, though. Think of it as training wheels until you get better at using your radar :)

I assume that you have already downloaded the source and have extracted the source from the tarball. Enter the extracted directory and go to the /src/bzflag/ directory and open Player.cxx with your favorite text editor. Use the search feature of your editor (e.g., ctrl+f for some text editors) and search for "cloak". The first thing you will find is:

// set the alpha target
if (effectFlag == Flags::Cloaking) {
alphaTarget = 0.0f;
} else {
alphaTarget = 1.0f;
}

Notice the line "alphaTarget = 0.0f;". Let's change 0.0f to 0.5f so that the line reads like this:

alphaTarget = 0.5f;

The effect will be that it is slightly translucent but not as much as zoned tanks (i.e., tanks with the Phantom Zone flag which are at 0.25f). Alternatively, you can use 1.0f instead of 0.5f.

Moving on. Search for "cloak" again. You now come to a section like this:

}

// is this tank fully cloaked?
const bool cloaked = (flagType == Flags::Cloaking) && (color[3] == 0.0f);

if (cloaked && !seerView) {
return; // don't draw anything
}

// setup the visibility properties

Let's remove the check for seeing if a tank is cloaked and not drawing anything if it is. The newly edited section should like this:

}

// setup the visibility properties

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

Have fun!

See STEALTH Tanks on Radar

By: Lord Jesus

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!

Thursday, July 26, 2007

Classic God Mode

By: Lord Jesus

Ever consider tinkering with "god mode" but just didn't quite know how? Well, you've come to the right place! With Classic God Mode, you will be invulnerable to shots, shock waves, guided missiles, lasers, steamroller, world weapons and so on. You will even be able to be like Jesus and drive on water. Tired of having your good flags stolen by Thief tanks? That will no longer be a problem either. A shortcoming, however, are that you will still be vulnerable to server /kill commands. That means admins can still /kill you, you will still blow up for killing teammates, and you will still blow up if you are a rogue and another rogue gets hit with genocide on a server with rogue genocide. Be sure to check out a later post about instant respawn ;)

Let's get started. After you've extracted the source tarball, navigate to the extracted directory. Once you're there, navigate on to the "/src/bzflag" directory. In that directory, you will find the file "playing.cxx". We'll work on some modifications to that file. Open your favorite text editor if you haven't already, open the file, and let's get going...

First, you may want to open a second editor and paste something like the following to it:

//skip this if alive
if (myTank->isAlive()) return;

We'll use it for quick pasting later on.

Also, I recommend backing up your original playing.cxx file for later use. Alternatively, you can extract a copy of the original file from your original tarball.

Now that you've got "playing.cxx" open it's time for a few changes. Use you editors "Find" feature (e.g., ctrl+f as with some graphic editors) to search for "see if" in the text of the file until you come to this section:

// see if i've been shot
const ShotPath* hit = NULL;

Hmmm... see if I've been shot? I'd rather not, if you don't mind >:) Let's do our paste action again so that the lines now read:

// see if i've been shot
// skip this if i'm alive
if (myTank->isAlive()) return;
const ShotPath* hit = NULL;

Next...

// if not dead yet, see if i'm sitting on death
else if (myTank->getDeathPhysicsDriver() >= 0) {

If not dead yet, then let's keep it that way. Let's paste again:

// if not dead yet, see if i'm sitting on death
// skip this if i'm alive
if (myTank->isAlive()) return;
else if (myTank->getDeathPhysicsDriver() >= 0) {

We'll continue making changes as we move along...

// if not dead yet, see if i've dropped below the death level
// skip this if i'm alive
if (myTank->isAlive()) return;
else if ((waterLevel > 0.0f) && (myTank->getPosition()[2] <= waterLevel)) {

And...

// if not dead yet, see if i got run over by the steamroller
// skip this if i'm alive
if (myTank->isAlive()) return;
else {

You're going to run across a few other lines pertaining to things such as guided missile. Keep searching past these entries, and you will find more "if not dead yet, see if ..." lines. Simply modify the lines as we've done above, you should be good to go on those.

Ah, you should be at the end of the document. You can run through it if you want to make sure that you hit all of the right spots :)

To be double sure, you can also search for "genocide". If you search from the beginning, keep using your Find Next feature, and you will find the line:

// blow up if killer has genocide flag and i'm on same team as victim
// (and we're not rogues, unless in rabbit mode)
if (human && killerPlayer && victimPlayer && victimPlayer != myTank &&

Now that looks intriguing. Let's add our own little touch to that, shall we?

// blow up if killer has genocide flag and i'm on same team as victim
// (and we're not rogues, unless in rabbit mode)
// skip this if i'm alive
if (myTank->isAlive()) return;
if (human && killerPlayer && victimPlayer && victimPlayer != myTank &&

Nothing like ignoring a teammate getting sacked with Genocide, huh? Keep in mind that some servers have rogues genocide. If you are playing on one of these servers as a rogue, then you will still get geno'd since the rogue genocide is handled by the server and sent to the client as a server kill message. Playing as a team color will eliminate that little problem.

Magnifico!

After that, save the file, compile your new client, and ...

Have fun!