Saturday, July 21, 2007

HOWTO: Reverse While Sealed with Oscillation Overthruster

Brought to you 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));

Let's remove the portion "|| (getFlag() == Flags::OscillationOverthruster && desiredSpeed < 0.0f && p[2] == 0.0f)" so that the edited section now reads like this:

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

Next, search for "(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));

Let's remove the portion "|| (hasOOflag && desiredSpeed < 0.0f && p[2] == 0.0f)" so that the edited section now reads like this:

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


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

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

Have fun!

Related posts:
HOWTO: Shoot While in a Building with Oscillation Overthruster
HOWTO: Flying Without Wings & Extended Jumping

1 Comments:

Blogger phasmophage said...

While I noticed that you have included mods for seeing cloaked and stealth tanks, I couldn't find anything about masquerade and invisible bullets. These are some fairly subtle, but useful, mods. So I thought I would include them:

First, to take out the confusion of masquerade, find these lines of code in playing.cxx:

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();
}
}

Replace the entire thing with:
const bool colorblind = false;
player[i]->addShots(scene, colorblind);

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

This should color masqueraded tanks correctly, and take out some of the effects of colorblindness.

Second to add invisible bullets to the radar, we need to edit radarRenderer.cxx.
Find the following line:
if (shot && (shot->getFlag() != Flags::InvisibleBullet || iSeeAll)) {

and replace it with this:
if (shot) {

Also, you'll find the following lines of code right after:

if (myTank->getFlag() == Flags::Colorblindness)
shotcolor = Team::getRadarColor(RogueTeam,rabbitMode);
else

Take out this part, so bullets are colored correctly on the radar if colorblind.

Hope this helps.
-phasmophage
(Aka/Formerly "Phaz")

7/21/2007 9:16 PM  

Post a Comment

<< Home