Monday, August 20, 2007

Reduce laser reload

By: Someone
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Laser fast-reload

In src/bzflag/SegmentedShotStrategy.cxx, find:
---
setReloadTime(_path->getReloadTime()
/ BZDB.eval(StateDatabase::BZDB_LASERADRATE));
---
Replace with:
---
setReloadTime(_path->getReloadTime()
* BZDB.eval(StateDatabase::BZDB_LASERADLIFE))

Enable Autopilot all the time

By: Someone
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Want to use autopilot on maps that disable it?

In src/bzflag/clientCommands.cxx, find:
---
if (BZDB.isTrue(StateDatabase::BZDB_DISABLEBOTS)) {
hud->setAlert(0, "autopilot not allowed on this server", 1.0f, true);
return std::string();
}
---
Remove it.

Auto Apologizer

By: Someone
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Do you ever tire of saying 'sry' to people you tk?

In src/bzflag/playing.cxx find:
---
if (myTank->isAutoPilot()) {
char meaculpa[MessageLen];
memset(meaculpa, 0, MessageLen);
strncpy(meaculpa,
"sorry, i'm just a silly machine",
MessageLen);
---
Replace it with:
---
if (myTank->isAutoPilot() || 1) {
char meaculpa[MessageLen];
memset(meaculpa, 0, MessageLen);
strncpy(meaculpa,
"sry",
MessageLen);

Find geno flag

By: Someone
This is how to find a geno flag with the top of your mousebox. Only works if phantom zone spoof is off.


Geno/other team flag finder: You know that there is a marker for your own team flag, and antidotes above the targeting square, so why not have one for geno, and other team flags?

In src/bzflag/playing.cxx, find:
---
static void prepareTheHUD()
{
// prep the HUD
if (myTank) {
const float* myPos = myTank->getPosition();
hud->setHeading(myTank->getAngle());
hud->setAltitude(myPos[2]);
if (world->allowTeamFlags()) {
const float* myTeamColor = Team::getTankColor(myTank->getTeam());
// markers for my team flag
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if ((flag.type->flagTeam == myTank->getTeam())
&& ((flag.status != FlagOnTank) ||
(flag.owner != myTank->getId()))) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, myTeamColor);
}
}
}
if (myTank->getAntidoteLocation()) {
// marker for my antidote flag
const GLfloat* antidotePos = myTank->getAntidoteLocation();
float heading = atan2f(antidotePos[1] - myPos[1],
antidotePos[0] - myPos[0]);
const float antidoteColor[] = {1.0f, 1.0f, 0.0f};
hud->addMarker(heading, antidoteColor);
}
}
return;
}
---
Replace it with:
---
static void prepareTheHUD()
{
// prep the HUD
if (myTank) {
const float* myPos = myTank->getPosition();
hud->setHeading(myTank->getAngle());
hud->setAltitude(myPos[2]);
if (world->allowTeamFlags()) {
// markers for my team flag
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if (flag.type->flagTeam != NoTeam) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, Team::getTankColor(flag.type->flagTeam));
}
}
}
if (myTank->getAntidoteLocation()) {
// marker for my antidote flag
const GLfloat* antidotePos = myTank->getAntidoteLocation();
float heading = atan2f(antidotePos[1] - myPos[1],
antidotePos[0] - myPos[0]);
const float antidoteColor[] = {1.0f, 1.0f, 0.0f};
hud->addMarker(heading, antidoteColor);
}
for (int i = 0; i < numFlags; i++) {
Flag& flag = world->getFlag(i);
if (flag.type == Flags::Genocide) {
const float* flagPos = flag.position;
float heading = atan2f(flagPos[1] - myPos[1],flagPos[0] - myPos[0]);
hud->addMarker(heading, flag.type->getColor());
}
}
}
return;
}
---

See his post on "Wings gravity fix for bloodbath"

Shoot Normal Bullets in PZ

By: Someone
(Sorry to take so long posting these, usually Lord Jesus posts other peoples' cheats. This is basically just copied exactly from someone's comment.)

In src/bzflag/ShotPath.cxx find:

if (tank.getFlag() == Flags::PhantomZone && !tank.isFlagActive()){

Replace it with:

if (tank.getFlag() == Flags::PhantomZone){

Sunday, August 12, 2007

Wings Gravity Fix for BloodBath

You may have noticed that if you tried to use the wings cheat in BloodBath, you'll start to fly away until you get autokicked. The problem lies in the fact that there are two separate gravity values: one for normal jumps and the other for wings. Normally, the value of gravity is negative (usually around -9.8) causing you to go downwards. However, when this value is set to a positive value, you start to shoot upwards. BloodBath set the wings gravity to 100, so you will shoot upwards. So here's a quick, one-liner fix so you can you the wings cheat on their server again.
For this cheat, you will need to edit LocalPlayer.cxx and find this line:

newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;

And add this line of code right before it:
if(BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) >= 0)BZDB.setFloat(StateDatabase::BZDB_WINGSGRAVITY, BZDB.eval(StateDatabase::BZDB_GRAVITY));

So your code should look like this, in the end:
if(BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) >=0 )BZDB.setFloat(StateDatabase::BZDB_WINGSGRAVITY, BZDB.eval(StateDatabase::BZDB_GRAVITY));
newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;

What this will do is check to see if wings gravity is set to a positive number, and if so, change it to the value of normal gravity.
Did I miss something? Was this helpful? Leave a comment.

Have fun. ;)
-Phaz

Wednesday, August 8, 2007

Quick Guide to Toggling Cheats and Wallwalking

By: Phasmophage

Many of you have asked how to toggle cheats. It is one of the most important things cheaters should know how to do. Having a phase cheat is pretty frustrating without being able to turn it off to land on buildings. It's also nice to turn off the wings cheat on servers like Bloodbath, where they reversed wings gravity to make cheaters with wings shoot up into the air until they are autokicked. So here's a non-specific guide on cheat toggling.
Now, the method I use for toggling toggles cheats when you say certain commands by pressing "z", "n", "m", "," or "." So, for example, to toggle god mode I would say "/god" to my teammates, or whoever. The program then recognizes "/god" as a keyword, toggles the cheat, and prevents "/god" from actually being sent. The file that controls sending messages to others is "ComposeDefaultKey.cxx". My personal ComposeDefaultKey.cxx is probably two times bigger than the original.

So let's get started, shall we? Open up "ComposeDefaultKey.cxx" and find these lines of code:
if (sendIt) {
std::string message = hud->getComposeString();
if (message.length() > 0) {
const char* cmd = message.c_str();
if (LocalCommand::execute(cmd)) {
;
} else if (serverLink) {

Let's focus on this line, for a second:
std::string message = hud->getComposeString();

"message" is our message (duh) that we're about to send out, so the "message" string is going to be very important to us later. But first, let me explain boolean variables. Boolean variables, or the "bool" type in C++ (the language used to create BZFlag) can only be true or false. This is the data type we will use to turn our cheats off and on. Now to access these variables from other files, (For example, we need to switch the variable in ComposeDefaultKey.cxx but perhaps the actual cheat is in playing.cxx) we need to declare a variable "extern" in some files.
Argh, I'm bad at explaining, so here's an example:
Open up playing.cxx and find these lines of code:

#ifdef ROBOT
static void handleMyTankKilled(int reason);
static ServerLink* robotServer[MAX_ROBOTS];
#endif


Right after those lines, put this:

bool bCheatOO = false;

That variable is our on and off switch that will let us walk through walls. The b is for "boolean" and the OO is for Oscillation Overthruster, and the "cheat" because we're cheating. You can name it whatever you want.

Now to access it in another file, like ComposeDefaultKey.cxx, find these lines of code:

#define MAX_MESSAGE_HISTORY (20)

MessageQueue messageHistory;
unsigned int messageHistoryIndex = 0;

and put this right after:
extern bool bCheatOO;

"Extern" tells us that this variable is defined elsewhere, but allows us to use it.
Now let's go back to these lines of code:

if (sendIt) {
std::string message = hud->getComposeString();
if (message.length() > 0) {
const char* cmd = message.c_str();
if (LocalCommand::execute(cmd)) {
;
} else if (serverLink) {

And change it to this:

if (sendIt) {
std::string message = hud->getComposeString();
if (message.length() > 0) {
const char* cmd = message.c_str();
if(message=="/oo")bCheatOO = !bCheatOO; //We added this line, which toggles bCheatOO
else if (LocalCommand::execute(cmd)) { //And put an "else" before "if"
;
} else if (serverLink) {

So if you enter "/oo" you'll switch the cheat to its opposite state.

Now, since the actual Oscillation Overthruster stuff is in LocalPlayer.cxx, let's open that up and find these lines of code:

/* local implementation headers */
#include "World.h"
#include "sound.h"
#include "ForceFeedback.h"
#include "effectsRenderer.h"

and put this right after:
extern bool bCheatOO;

Now for the real cheats. Find these lines of code:
// phased means we can pass through buildings
const bool phased = ((location == Dead) || (location == Exploding) ||
(getFlag() == Flags::OscillationOverthruster) ||
isPhantomZoned());

and change it to this:
const bool phased = ((location == Dead) || (location == Exploding) ||
(getFlag() == Flags::OscillationOverthruster) ||
isPhantomZoned() || bCheatOO);

See how we added "|| bCheatOO" to the end? This means if we have Oscillation Overthruster, Phantom Zone, OR if bCheatOO is turned on, then we can pass through buildings.

Find this line of code:
if (location == InBuilding && getFlag() == Flags::OscillationOverthruster) {

And change it to this:
if (location == InBuilding && (getFlag() == Flags::OscillationOverthruster || bCheatOO)) {

Actually, that line isn't too important, it just shows the the weird effects when you're crossing a wall.

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

and change it to this:
if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
obstacle->getType() == Teleporter::getClassName() ||
(getFlag() == Flags::OscillationOverthruster && !bCheatOO && desiredSpeed < 0.0f &&
p[2] == 0.0f));

This time, we added "&& !bCheatOO" meaning "And bCheatOO is NOT turned on" because what these lines of code do is make sure that we can't back up in buildings. And we do want to.
Find these lines of code:

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

And change it to this:
expelled = (obstacle != NULL);
if (expelled && phased)
expelled = (obstacle->getType() == WallObstacle::getClassName() ||
(!bCheatOO && obstacle->getType() == Teleporter::getClassName()) ||
(hasOOflag && desiredSpeed < 0.0f && !bCheatOO && p[2] == 0.0f));

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


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

Find this line of code:
if (! (firingStatus == Ready || firingStatus == Zoned))
return false;


Which doesn't let us fire if we we're sealed, and change it to this:
if (! (firingStatus == Ready || bCheatOO || firingStatus == Zoned))
return false;


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

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


And that's all of it. I think. If this doesn't work, let me know. Hopefully, this will teach you how to toggle your cheats. Again, every cheater needs to know how to do this. Seriously. Have fun with this! And if you have any ideas, critiques, or if you enjoyed this not-so-quick cheat guide: Please, leave a comment. ;)
And I am out!
-Phaz

No Blindness

Another, really easy cheat. So you can see out the window.

Open playing.cxx and find this line of code:

if (bestTarget->isHunted() && myTank->getFlag() != Flags::Blindness &&

And change it to this


if (bestTarget->isHunted() &&

Then find these lines of code:
sceneRenderer->setBlank(myTank && (myTank->isPaused() ||
myTank->getFlag() == Flags::Blindness));
And change it to this:

sceneRenderer->setBlank(myTank && (myTank->isPaused()));

Or just delete it altogether.

And that's pretty much it. If I forgot anything, leave a comment.
-Phaz

No Jamming

Jamming is one annoying flag. Actually, I wouldn't know because whenever I had the jamming flag, I had this cheat preventing the effects. This is a really simple and subtle cheat that every cheater needs. I can't believe this wasn't posted yet.

For this cheat, open playing.cxx and find this line of code:
radar->setJammed(flag == Flags::Jamming);

and change it to this:
radar->setJammed(false);

And that's pretty much it. Hope I didn't forget anything.
-Phaz

Sunday, August 5, 2007

Avoid Picking Up Bad Flags

Brought to you by: Someone

You may recall that we have posted some techniques for minimizing the impact of bad flags:

1. Drop Bad Flags Instantly.
2. Drop Bad Flags Like Regular Flags.

We now bring you yet another technique: avoid picking them up altogether. With this edit, if a flag is bad, you will simply drive over it without picking it up.

For this, we're going to playing.cxx in /src/bzflag/ of the extracted source. Search for "if (world->getFlag(i).type == Flags::Null ||", and you will find this section:

if (world->getFlag(i).type == Flags::Null || world->getFlag(i).status != FlagOnGround)
continue;

Notice the second line. After the "!= FlagOnGround", we are going to add this:

|| world->getFlag(i).type->flagQuality == FlagBad

The section should now read like this:

if (world->getFlag(i).type == Flags::Null || world->getFlag(i).status != FlagOnGround ||
world->getFlag(i).type->flagQuality == FlagBad)
continue;

Save the file, compile your client, and you're done. To see Someone's original instructions for this tip, read his comment to "Stealth Tanks Blink on Radar". As always...

Have fun!

Immunity from Team Kill and Self Kill Shots

Brought to you by: Someone

Have you ever been chasing down an enemy only to be killed by a teammate shooting at the same enemy? Have you ever been killed by your own shots? Here's a tip that prevent shots from teammates and yourself from killing you.

For this edit, we're going to playing.cxx in /src/bzflag/ of the extracted source. Search for " myTank->checkHit(myTank, hit, minTime);", and you will find this section:

float minTime = Infinity;

myTank->checkHit(myTank, hit, minTime);
int i;
for (i = 0; i < curMaxPlayers; i++)
if (player[i])
myTank->checkHit(player[i], hit, minTime);

Let's remove the line "myTank->checkHit(myTank, hit, minTime);" so that the section now reads like this:

float minTime = Infinity;

int i;
for (i = 0; i < curMaxPlayers; i++)
if (player[i])
myTank->checkHit(player[i], hit, minTime);

Next, we are going to add a new line immediately below "if (player[i])":

if (player[i]->getTeam() != myTank->getTeam() || myTank->getTeam() == RogueTeam)

The section should now read like this:

float minTime = Infinity;

int i;
for (i = 0; i < curMaxPlayers; i++)
if (player[i])
if (player[i]->getTeam() != myTank->getTeam() || myTank->getTeam() == RogueTeam)
myTank->checkHit(player[i], hit, minTime);

Save the file, compile your new client, and you're done. To see Someone's original instructions, read his comment "Stealth Tanks Blink on Radar". As always...

Have fun!

Saturday, August 4, 2007

Guided Lasers

By: Phasmophage
Okay, I was originally planning to keep this in reserve due to its immense power. But, due to popular demand (namely randomdude), I have decided to post it.

Guided lasers allow you to lock on to an opponent's position and have perfect accuracy when shooting at them. To do this, we will need to edit two source files: playing.cxx and LocalPlayer.cxx.

The reason we will be editing playing.cxx is to allow us to lock on with lasers. So, find these lines of code:

// see if it's inside lock-on angle (if we're trying to lock-on)
if (a < BZDB.eval(StateDatabase::BZDB_LOCKONANGLE) && // about 8.5 degrees
((myTank->getFlag() == Flags::GuidedMissile) || // am i locking on?
tankHasShotType(myTank, Flags::GuidedMissile)) &&
player[i]->getFlag() != Flags::Stealth && // can't lock on stealth
!player[i]->isPaused() && // can't lock on paused
!player[i]->isNotResponding() && // can't lock on not responding
d < bestDistance) {
bestTarget = player[i];
bestDistance = d;
lockedOn = true;
}

and change this line:
((myTank->getFlag() == Flags::GuidedMissile) || // am i locking on?

to this:
((myTank->getFlag() == Flags::GuidedMissile) || (myTank->getFlag() == Flags::Laser) || // am i locking on?


You will also find these lines, very similar to the lines before:
if (a < BZDB.eval(StateDatabase::BZDB_LOCKONANGLE) && // about 8.5 degrees
myTank->getFlag() == Flags::GuidedMissile && // am i locking on?
player[i]->getFlag() != Flags::Stealth && // can't lock on stealth
!player[i]->isPaused() && // can't lock on paused
!player[i]->isNotResponding() && // can't lock on not responding
d < bestDistance) { // is it better?
bestTarget = player[i];
bestDistance = d;
lockedOn = true;
}

Now change this line:
myTank->getFlag() == Flags::GuidedMissile && // am i locking on?

To this:
(myTank->getFlag() == Flags::GuidedMissile || myTank->getFlag() == Flags::Laser) && // am i locking on?

That's all the edits for playing.cxx

We will now edit LocalPlayer.cxx and find these lines of code:
else {
// apply any handicap advantage to shot speed
if (handicap > 0.0f) {
const float speedAd = 1.0f + (handicap * (BZDB.eval(StateDatabase::BZDB_HANDICAPSHOTAD) - 1.0f));
const float* dir = getForward();
const float* tankVel = getVelocity();
const float shotSpeed = speedAd * BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
firingInfo.shot.vel[0] = tankVel[0] + shotSpeed * dir[0];
firingInfo.shot.vel[1] = tankVel[1] + shotSpeed * dir[1];
firingInfo.shot.vel[2] = tankVel[2] + shotSpeed * dir[2];
}

Now add these lines of code after it: (Wrote it myself, so it's pretty cruddy looking)
bool LockedOn = false;
const Player * target = getTarget();
if(target){
//const float* tankVel = getVelocity();
const float shotSpeed = BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
float newAz = TargetingUtils::getTargetAzimuth( getPosition(), target->getPosition() );
float newPos[3];
const float * tarPos = target->getPosition();
float enemyPos[3];
const float *tv = target->getVelocity();
enemyPos[0] = tarPos[0] + (0.3f * tv[0]); //Lag adjustment
enemyPos[1] = tarPos[1] + (0.3f * tv[1]);
enemyPos[2] = tarPos[2] + (0.3f * tv[2]);
const float * myPos = getPosition();
const float * myDir = getForward();
newPos[0] = enemyPos[0] - ( myPos[0] + (myDir[0] * 0.1)); //Muzzlefront?
newPos[1] = enemyPos[1] - ( myPos[1] + (myDir[1] * 0.1)); //Muzzlefront?
newPos[2] = enemyPos[2] - myPos[2];
//newPos[2] += target->getMuzzleHeight(); // right between the eyes
float newElevation = atan2f(newPos[2], hypotf(newPos[1], newPos[0]));
float newDir[3] = {cosf(newAz), sinf(newAz), sinf(newElevation)};
firingInfo.shot.vel[0] = /*tankVel[0] +*/ shotSpeed * newDir[0];
firingInfo.shot.vel[1] = /*tankVel[1] +*/ shotSpeed * newDir[1];
firingInfo.shot.vel[2] = /*tankVel[2] +*/ shotSpeed * newDir[2];
LockedOn = true;
}

// Set _shotsKeepVerticalVelocity on the server if you want shots
// to have the same vertical velocity as the tank when fired.
// keeping shots moving horizontally makes the game more playable.
if (!LockedOn && !BZDB.isTrue(StateDatabase::BZDB_SHOTSKEEPVERTICALV)) firingInfo.shot.vel[2] = 0.0f;

Oh yeah, forgot, the last four lines should replace these lines:

// Set _shotsKeepVerticalVelocity on the server if you want shots
// to have the same vertical velocity as the tank when fired.
// keeping shots moving horizontally makes the game more playable.
if (!BZDB.isTrue(StateDatabase::BZDB_SHOTSKEEPVERTICALV)) firingInfo.shot.vel[2] = 0.0f;

This will allow your lasers to shoot down or up at people, so this cheat sticks out like a sore thumb.

Oh yeah, forgot again. You'll need to put
#include "TargetingUtils.h"
after this line:
#include "effectsRenderer.h"


And that's basically it. This powerful cheat written by phasmophage (aka "Phaz" or me) and brought to you exclusively by bzfcheat.blogspot.com.
If there is anything I might have forgotten, bad math, bad implementation, or if you actually really like it, comments are greatly appreciated.

Have fun!
-Phaz
;)

Friday, August 3, 2007

Stealth Tanks Blink on Radar

By: Phasmophage
This post assumes that you have already taken out the code that blocks you from seeing stealth tanks on your radar. If you haven't already done so, follow the directions in the post titled "See STEALTH Tanks on Radar."

Here is a great way for you not to blow your cover as a cheater. If you have Super Bullet, you don't want to hit a stealthed tank behind a wall. To make sure you know which tanks are stealthed so you can approach them with caution and not blow your cover, we will make them blink.

This quick and easy edit requires that you open RadarRenderer.cxx and find these lines of code:

if (flashTank.isOn()) {
if (!toggleTank) {
float flashcolor[3];
flashcolor[0] = 0.0f;
flashcolor[1] = 0.8f;
flashcolor[2] = 0.9f;
glColor3fv(flashcolor);
}
} else {
toggleTank = !toggleTank;
flashTank.setClock(0.2f);
}
}

Now, just put this right after it:
//Start stealth flash
if ((player->getFlag() == Flags::Stealth)) {
static TimeKeeper lastTime = TimeKeeper::getCurrent();
static bool flash = false;
const float elapsed = float(TimeKeeper::getCurrent() - lastTime);
if(elapsed < 0.3f){
if(!flash)
{
float flashcolor[3];
flashcolor[0] = 0.5f; //This controls the color of the flash.
flashcolor[1] = 0.5f;
flashcolor[2] = 0.5f;
glColor3fv(flashcolor);
}
}
else
{
flash = !flash;
lastTime = TimeKeeper::getCurrent();
}
}
//End stealth flash

This will make stealthed tanks blink a gray color on your radar. If you want it to blink faster, change 0.3 to a smaller number, or a bigger number to blink more slowly. You can edit the 0.5f's to fit your tastes in color.

Don't blow your cover,
-Phaz ;)