Forums Index >> Modding >> Get more out of your score.



Page : <1> :


In my server, scores now show up in the form "nKm", where n is the number of points awarded by objects like scrum goals, and m is the number of kills made. For example, someone who killed 6 people, one of whom was on his team, and scored 3 goals would have the score "3K4".
Want the script to DIY? Here it is.
EDIT: None of the first letters in a line should be capitalized! Check that before pestering me.

 

                                        
function TankData::onDestroyed(%db,%this,%killer)
{
If ($Game::SinglePlayer)
{
%db.onSPDestroyed(%this,%killer);
Return;
}
If ($Game::TargetRange)
{
%db.onTargetDestroyed(%this,%killer);
Return;
}
// need to deal with both ai bots and players as killer's and killee's
%client = %this.client;
%client.deaths++;
// echo("killed tank: " @ %this @ ", client: " @ %client);
// echo("killer tank: " @ %killer @ ", client: " @ %killerClient);
If (isObject(%killer))
{
MessageAll('MsgClientKilled','%1 has been keelhauled by %2!',%client.name,%killer.client.name);
echo(%client.nameBase @" has been keelhauled by" SPC %killer.client.nameBase @"!");
// if ($Game::MissionType $= "Deathmatch")
// {
// this is a score...
If ($Game::TeamGame)
{
If (%killer.client.team.getId() != %client.team.getId())
%killer.incScore(0,1,1);
}
Else
%killer.incScore(0,-1,-1);
// }
%killer.client.kills++;
}
Else
{
MessageAll('MsgClientKilled','%1 has committed suicide. Bad tank, bad!',%client.name);
echo(%client.nameBase @" committed suicide. Bad tank, bad!");
}
If ($Game::MissionType $= "Deathmatch")
{
If ($Game::TeamGame)
{
If (isObject(%killer) && %killer.client.team.getId() == %client.team.getId())
// team killer, lose point
%this.incScore(0,-1,-1);
Else
%this.incScore(0,-1,0);
}
Else
%this.incScore(0,-1,-1);
}
If (!isObject(%client.ai))
{
If ($Game::aiControlMode)
{
%client.player = 0;
%client.schedule(4000,"spawnPlayer");
}
Else
CommandToClient(%client,'CenterPrint',"Your brain has been separated from your tank, press SPACE.", 0, 1 );
}
Else
SpawnBotPlayer(%client);
}
Function Tank::incScore(%this,%delta,%deltaTeam,%kills)
{
%client = %this.client;
%score = %client.score;
If (%score == 0)
%score = "0K0";
%score1 = getSubStr(%score,0,strstr(%score,"K"));
%score2 = getSubStr(%score,strstr(%score,"K")+1,strlen(%score));
%score1 += %delta;
%score2 += %kills;
%client.cumScore += %delta;
If (isObject(%client.team))
{
If (-%deltaTeam>%client.team.score)
{
%client.team.cumScore -= %client.team.score;
%client.team.score = 0;
}
Else
{
%client.team.score += %deltaTeam;
%client.team.cumScore += %deltaTeam;
}
}
%client.score = %score1 @"K"@ %score2;
}

 

Add that to the end of Tank2.cs. Then, find where in special.cs it says "incScore(1,1)" in the powerupData::onEnter function. Change that to "incScore(1,1,0)". PS: This includes a fixed teamkiller bug.
Happy tanking/hacking!

Last edited: Thursday, June 29, 2006 at 11:27:29 AM

Monday, June 26, 2006 at 9:37:21 AM

It isnt hard, but gj :P


Monday, June 26, 2006 at 12:29:58 PM

Yes, good job DJ, you are the hack master of TT.

Maybe you can find all the small hacks youve done and put them together in some sort of Gametype :)

Monday, June 26, 2006 at 9:58:24 PM

Really nice job DJ. I'm sure It'll work great against BM'ers in scrum.

YAY for gradients!

Only lethal on days that end with "Y"

Last edited: Monday, June 26, 2006 at 11:20:14 PM

Monday, June 26, 2006 at 11:19:04 PM

This look very cool. Could you be a bit more specific as to were it should be placed in the tank2.cs. If I just place it at the end of the file it looks as though I will be repeating a bunch of information. Would it be possible to show your whole tank2.cs?

 

Tuesday, June 27, 2006 at 9:33:07 PM

Could you make it show the amount of times you were killed as well?

Wednesday, June 28, 2006 at 7:54:57 AM

Where do u get Tank2.cs? :)

my blaster will destroy u!

Thursday, June 29, 2006 at 1:16:09 PM

My site.

Last edited: Thursday, June 29, 2006 at 2:22:00 PM

Thursday, June 29, 2006 at 2:21:25 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald