Saturday, July 28, 2007

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

1 comment:

Sk3letr0n said...

Hey this doesn't work at all. I don't know if you left something out or what but it just doesn't work at all. It even makes it so that you can't pause at all, as if there is no pause function.

However, I'm working on a version of this that actually works and has better features such as:

Drive while paused
Shoot while paused
Don't loose your flag when paused
Server doesn't choose new rabbit on rabbit chase servers when you pause

And there will be a few others if I think about it. I'll going to finish it up tonight and I'll post it then. ;)