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!

1 comment:

Sk3letr0n said...

Dude this is the best! Can I use this with 2.0.10?