Tuesday, January 1, 2008

Super "Kill Me" on Demand

By: Lord Jesus

Got an annoying teammate that needs to be kicked (if the server kicks for team kills)? Perhaps that annoying teammate simply needs calibration with a point reduction... Or, how would you like to be able to hook up your buddies with some mad points?

Here's a modification to Choose Who Kills You brought to you by a collaboration between blogger,Someone, and BZFlag Cheat's newest team member, NightMare.

With "Choose Who Kills You", you enter in your command to be killed by another player on demand (e.g., "/k"). The getting killed ends after you blow up and the point is transferred. Let's say, though, that you would like to do it over and over again without having to enter the command manually each and every time. One way might be to set up a macro such as ctrl+k to enter "." + /k + [Enter] to facilitate rapid keystroke entries. Another way might be to set up a key command and select victims similar to the way in which one uses "k" to silence or "unsilence" other players. There are a variety of ways which are possible. After all, there are usually more than one way to skin a cat, as the old saying goes.

The technique that we will use here is to set up a command for it. A separate command is used to terminate the automatic suicide, as it were. Additionally, this particular method works separately from killMe, so you can use either one without conflict. The example that we use here will show lines of code for both. The single killMe is optional, of course, but highly recommended :)

Before we begin, let's review some limitations. This method described here (as well as single killMe) will NOT work if you:
    1. have god mode enabled. This is highly important. If you can toggle god mode, ensure that it is toggled off. Otherwise, you will need to build without the god mode cheat or nothing will happen when you try to use the Super killMe (or single killMe, for that matter). UPDATE: See Using God Mode with Choose Who Kills You if you want to use (or would like to continue to use) god mode.

    2. are an observer. Note, though, that you can choose to be killed by an observer. You just can't be killed while YOU are an observer.

    3. have not yet spawned (e.g., when you first join a server).

    4. are dead. For the automatic Super killMe, I strongly recommend that you utilize Respawn Instantly.

Additionally, I have noticed that commonly at least one player on a server is not affected by either killMe or Super killMe. So, if you go to try it out and it doesn't work on the first victim, try some others just to be sure. Also, if a victim leaves the server during the automatic Super killMe (e.g., getting kicked for team killing, just simply leaving, and so on), then the killed message will reflect that you have been killed by the server. This occurs when you are killed by an unknown player (a player who has signed off is a player that no longer exists).

playing.cxx

Let's begin now by going back to playing.cxx. Do you remember where we added "int killMe"? Let's add another one so that the section looks like this (from the beginning of the file):

/* bzflag
* Copyright (c) 1993 - 2006 Tim Riker
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the license found in the file
* named COPYING that should have accompanied this file.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

// interface header
#include "playing.h"

// system includes
#ifdef _WIN32
#include
#include
#include
#include
#else
#include
#include
#include
#include
#include
#endif
#include
int killMe;
int SuperkillMe;

Next, search for "used later", and you will find this section:

// used later
float waterLevel = World::getWorld()->getWaterLevel();

if (hit) {
// i got shot! terminate the shot that hit me and blow up.

Look at the second line:

float waterLevel = World::getWorld()->getWaterLevel();

Below that, let's add our lines of code:

if (killMe)
{
gotBlowedUp(myTank,GotShot,killMe);
killMe = 0;
}

if (SuperkillMe)
{
gotBlowedUp(myTank,GotShot,SuperkillMe);
}

Look at the line below the addition above:

if (message.length() > 0) {

Add "else" at teh beginning of the line so that it now reads like this:

else if (message.length() > 0) {

The edited section should now look like this:

// used later
float waterLevel = World::getWorld()->getWaterLevel();

if (killMe)
{
gotBlowedUp(myTank,GotShot,killMe);
killMe = 0;
}

if (SuperkillMe)
{
gotBlowedUp(myTank,GotShot,SuperkillMe);
}
else if (message.length() > 0) {

if (hit) {
// i got shot! terminate the shot that hit me and blow up.

Notice that in the killMe section you see "killMe=0" but SuperkillMe does not have a corresponding line. The line resets killMe so that the process of getting blown up doesn't keep going and going. This allows you to have single use killMe. Since we want the automatic killMe (i.e., SuperkillMe) to keep going, there is no line resetting that value back to 0.

UPDATE: As mentioned previously, this cheat would continue the SuperkillMe even after the player signs off or gets kicked. Thus, the killer is then unknown and the killed message is "Killed by the server", and you would have to use your command to end it (such as /ks) to stop the SuperkillMe. Here's a simple fix to end the SuperkillMe automatically when the player no longer on the server.

Let's continue with playing.cxx and search for "Killed by the server". You will will find this section:

} else {
// 1-4 are messages sent when the player dies because of someone else
if (reason >= GotShot && reason <= GenocideEffect) {
Player *killerPlayer = lookupPlayer(killer);
if (!killerPlayer) {
blowedUpNotice = "Killed by the server";
} else {

Notice this line: blowedUpNotice = "Killed by the server";

After that line, add this line:

SuperkillMe = 0;

The section should now look like this:

} else {
// 1-4 are messages sent when the player dies because of someone else
if (reason >= GotShot && reason <= GenocideEffect) {
Player *killerPlayer = lookupPlayer(killer);
if (!killerPlayer) {
blowedUpNotice = "Killed by the server";
SuperkillMe = 0;
} else {

At this point, we are finished with editing playing.cxx.

ComposeDefaultKey.cxx

Next, let's go to setting up the actual commands. For this we go to ComposeDefaultKey.cxx. Do you recall where we put "extern int killMe;"? Search for "MAX_MESSAGE_HISTORY (20)", and you will come to this section:

#define MAX_MESSAGE_HISTORY (20)

MessageQueue messageHistory;
unsigned int messageHistoryIndex = 0;


static bool isWordCompletion(const BzfKeyEvent& key)

Notice the line "unsigned int messageHistoryIndex = 0;". Below that, we will add our lines of code:

extern int killMe;
extern int SuperkillMe;

The edited section should look like this:

#define MAX_MESSAGE_HISTORY (20)

MessageQueue messageHistory;
unsigned int messageHistoryIndex = 0;
extern int killMe;
extern int SuperkillMe;

static bool isWordCompletion(const BzfKeyEvent& key)

Next, let's set up our commands. Here, we use "/k" for a single killMe, and we use "/kk" for SuperkillMe. Keep in mind that you are free to use any command that you desire. For example, if you prefer /killme over /k, then edit that line accordingly. Search for "if (sendIt) {", and you will see this section:

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

Notice the line "std::string message = hud->getComposeString();". Below that, we will add our lines of code:

if(message=="/kk") {
const Player *someOther = LocalPlayer::getMyTank()->getRecipient();
if (someOther)
{
SuperkillMe = someOther->getId();
}
}

else if(message=="/ks") {
SuperkillMe = 0;
}

else if(message=="/k") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
killMe = Other->getId();
}
}

The next line after our addition is "if (message.length() > 0) {". Let's add "else" in front of that so that the line now reads like this:

else if (message.length() > 0) {

The section after our change should now read like this:

if (sendIt) {
std::string message = hud->getComposeString();

if(message=="/kk") {
const Player *someOther = LocalPlayer::getMyTank()->getRecipient();
if (someOther)
{
SuperkillMe = someOther->getId();
}
}

else if(message=="/ks") {
SuperkillMe = 0;
}

else if(message=="/k") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
killMe = Other->getId();
}
}

else if (message.length() > 0) {
const char* cmd = message.c_str();
if (LocalCommand::execute(cmd)) {
;
} else if (serverLink) {
char messageBuffer[MessageLen];

In the example above, we used "/ks" as the command to terminate the automatic getting killed on demand, or SuperkillMe. When we enter the command "/ks", SuperkillMe is set to 0, and automatic getting killed is over until we initiate it again.

After you make your changes, save your files, compile your new client, and you're done. Watching dead or paused players rack up points or team kills can be quite amusing... as well as observers going on killing sprees :P

In the immortal words of dj28:

"Have fun pissing people off and ruining their fun."

>:)

**********

Related posts:

Choose Who Kills You
Using God Mode with Choose Who Kills You

6 comments:

randomdude said...

Thanks for the new cheats. I was beginning to wonder if there were any cheats left =)
Not on my good computer at the moment, but can't wait to try them out.
Is there any chance i could have a lag spoof cheat? Sorry i ask so much people always identify me by my lag.

CRW said...

randomdude,

Thank you very much for visiting and your feedback. Even though the number of comments to Clientquery Spoofing only indicates 38 (the indication was 37 when you posted your last comment), I left a few comments for you in response to getting killMe to work including what may be preventing it from working for you. The discrepancy in comment numbers is due the permanent deletion of comments which had been removed by their respective authors -- I was eliminating unnecessary clutter. Anyway, I mentioned those limitations here, too, in the Super "Kill Me" on Demand post. Make sure you take a look at those limitations if you haven't already.

As for lag spoofing, I'm not sure if that one is possible right off the top of my head. I'm guessing that you either use dial-up and/or you live in a country far away from most servers (high or moderately high lag). Inserting artificial lag might be possible, but I am not sure if spoofing a high lag as normal lag is possible (e.g., making a dial-up connection appear as fast as DSL with respect to lag). Neverthesless, we'll be looking into it. I don't want you to think that we're blowing you off.

Being able to be identified may not be such a big deal, though. I'm easily identified by my custom clientquery. Various cheaters usually have some identifiers anyway such as consistent callsigns, clientquery information, connection information (such as Internet Server Provider, domain, IP address or IP range), common mode(s) of operation, and so on. Being covert may not necessarily be a priority especially if you are shooting guided lasers while flying, using Super Kill Me, and other such blatant cheats :P

I've been really busy over the past few months (hence my relative absence), and Phaz has been too busy to post much of anything new over the past couple of months himself. Don't think, though, that just because there may be some occasional lulls that the blog has stopped. We're still here, and we're going to continue on.

That said, if you meet others with cheats that aren't posted here, please encourage sharing if they are willing. We welcome more tips any time. Blogger "Someone" has frequently contributed, and we always welcome anyone to contribute. Gotta keep the ideas flowing, you know :D

Again, thanks for visiting, and let us know how the latest edition of cheats work out for you.

CRW said...

... if you use Windows, then you may consider trying Cheat Engine:

http://cheatengine.org/

Being that I don't use Windows, I haven't tried it in a long time. Death Barrel used to use it with BZFlag 2.0.4 as a speed cheat which didn't get him kicked for driving too fast. The appearance was that he lagged badly since his tank would rapidly move from one position to another.

Again, I haven't tried it in a long time, so I don't know how well it works with BZFlag anymore. If you do get a chance to try it out, let us know how Cheat Engine works with BZFlag these days.

person said...

I have a suggestion, similar to the opposite of lag spoofing, if that makes sence. Maybe there could be a client side delay so that when the tank detects that it has been shot, it will let you live for just a little longer, giving you a short time in which you could kill your killer before you died. Like for example. I get in a fight with a shock waver. I wait for him to land, but am hit before he lands. Instead of exploding, I would have 2 seconds to kill him first.

CRW said...

Great idea! In addition to that, I'm thinking of having an "Imminent Death" countdown display similar to the pause countdown. I would also want to skip the countdown if we initiate killMe or SuperkillMe.

Speaking of which, I'm going to be posting a god mode fix for those so that you can have killMe and SuperkillMe with god mode. That is, you are in god mode and only blow up when you initiate getting killed by someone.

Anyway, I am going to start working on the delayed death. Thanks for the idea!

person said...

Your welcome! I am looking forward to its release. It will be very subtle as long as the delay isn't too large.