Forums Index >> Modding >> Is there a quick way to change the score to regist...



Page : <1> :


If a player gets killed and he has 0 kills is there a way to change it so it registers negative numbers?

Or is there a way to change it so that a player does not lose a point when he is killed?

Last edited: Saturday, July 02, 2005 at 4:04:12 PM

Saturday, July 02, 2005 at 4:03:01 PM

That's quite an idea! XD but I don't know how to do it :[

Saturday, July 02, 2005 at 11:37:07 PM

Possible and easy :)
I could do it fast and easy, but that'd reveal the secret of putting scores as a text string...
So no...


Sunday, July 03, 2005 at 5:58:54 AM

Yippee! I love when I know something and keep it secret :) I love secrets! %) Art when u done ur admin script make a mod with all your secrets in! That will never get boring unless you reveal your secrets B) haha

Sunday, July 03, 2005 at 6:06:56 AM

Lol you dont get it... You cant just set a text string as the client score, you need to use some deeper codes...


Last edited: Sunday, July 03, 2005 at 7:32:05 AM

Sunday, July 03, 2005 at 6:30:35 AM

Ups typo :)
Its easy thou... And Team rescue is 100 times easier than CTF... I just dont make it cos I dont have anough time


Sunday, July 03, 2005 at 7:32:49 AM

Well, there are none... Like you have a number, to convert it to a string you could just make it as ""@%number@"" and sometimes just using %number might work, it depends on the function... You can also add and remove from a string is its totaly a number... So TGE almost doesnt need conversions...


Sunday, July 03, 2005 at 7:41:28 AM

No...
as you need a more deeper script for that to work lol


Sunday, July 03, 2005 at 9:57:44 AM

Ok perhaps I shouldn't have said easy. What is the harder way to do it? If it's not to much trouble for you?

Sunday, July 03, 2005 at 11:50:02 AM
b20

Oh bummer. I wish this wasn't a secret! Oh well. I got my ultamate scrum bots up and running and the programming is TOP SECRET! XD

-CUC-

P.S. Oh and Jet Jaguar your an ok guy after all! :)

- b20

Sunday, July 03, 2005 at 12:06:03 PM

If ($Game::TeamGame)
{
if (%killer.client.team.getId() != %client.team.getId())
%killer.incScore(-65756757577575); //<----//Change this crap
}
else
%killer.incScore(64646464757575);// <----//Change this crap
}
%killer.client.kills++;
}
else
{
messageAll('MsgClientKilled','%1 has been eliminated!',%client.name);
}

I honestly don't know what the heck you're talking about, AC. You don't need a darn a thing expect the stuff that is right here on this website. No deep codes or Art Crazy's coding genius needed.

The above text came out of tank2.cs, download it from the "Other Stuff" caption of this website. You need to use all the text in it, the above caption by its self wont do anything alone by its self

Put it in your game/server/scripts folder and add exec("game/server/scripts/tank2.cs") to the top of the mssion file you want to use it on.

Open up AC, if you know how to do something then tell people how, especially if you're going to go as far to saying "OH I COULD DO IT THATZ EASY". Freaking post the code then, and stop patting yourself on the back. Jesus.

Moderator's comments: Don't use foul language, please! Thanks

Last edited: Friday, July 08, 2005 at 11:19:39 AM

Monday, July 04, 2005 at 5:54:05 AM

I tried it but it didn't seem to work. Was there text in the tank2.cs file that I should have deleted?

Monday, July 04, 2005 at 6:37:45 PM
b20

Didn't work for me either. Tried a series of numbers in the posititions but still didn't work. :[

Wish Art Crazy would crack the secret someday!

- b20

Monday, July 04, 2005 at 8:36:54 PM

@apple
Well... If it was THAT easy... I would have told it already... (well its not hard) but you need to use a deeper script... Research tank2.cs :)


Thursday, July 07, 2005 at 11:04:27 AM
b20

Hmm... I suspected these when looking around in the tank2.cs:

 

                                        
%client.player = 0;

 

 

                                        
%client.score = 0;

 

 

                                        
%client.team.score = 0;

 

My prediction is that when someone is at 0 and got killed, they would still end up at 0. So... I would think putting like -1 will make it correct? :o

-CUC-

- b20

Thursday, July 07, 2005 at 12:15:03 PM
b20

So we put that at the end of the Tank2.cs! Yipee! But it seems like Survivor near the end...

-CUC-

- b20

Thursday, July 07, 2005 at 12:48:03 PM
b20

I tried it but it didn't work. Anymore idea guys?

-CUC-

- b20

Thursday, July 07, 2005 at 6:26:59 PM
b20

Here is what I got:

 

Exec("./tank.cs");

//-----------------------------------------------------------------------------

Function TankData::create(%block)
{
switch$(%block)
{
case "LightTank":
%obj = new Tank() {
dataBlock = %block;
};
return(%obj);
case "MediumTank":
%obj = new Tank() {
dataBlock = %block;
};
return(%obj);
case "HeavyTank":
%obj = new Tank() {
dataBlock = %block;
};
return(%obj);
}
return(-1);
}

Function TankData::onAdd(%this,%obj)
{
}

Function TankData::onTargetDestroyed(%db,%this,%killer)
{
// need to deal with both ai bots and players as killer's and killee's

%isPlayerKilled = isObject(%this.client);
%isPlayerKiller = isObject(%killer.client);

If (%isPlayerKiller)
{
%killer.incScore(1,1);
%killer.client.kills++;
if (%killer.client.kills % 10 == 0)
spawnTarget(TargetSaucer);
}
if (%isPlayerKilled)
commandToClient(%client,'CenterPrint',"Your brain has been separated from your tank, press SPACE.", 0, 1 );
else if (%this.dataBlock.getName() !$= "TargetSaucer")
spawnTarget(%this.dataBlock);

If (LocalClientConnection.kills == 5)
schedule(1500,0,"exitTargetPractice");
}

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 eliminated by %2!',%client.name,%killer.client.name);
if ($Game::MissionType $= "Deathmatch")
{
// this is a score...
if ($Game::TeamGame)
{
if (%killer.client.team.getId() != %client.team.getId())
%killer.incScore(1,1);
}
else
%killer.incScore(1,1);
}
%killer.client.kills++;
}
else
{
messageAll('MsgClientKilled','%1 has been eliminated!',%client.name);
}

If ($Game::MissionType $= "Deathmatch")
{
if ($Game::TeamGame)
{
if (isObject(%killer) && %killer.client.team.getId() == %client.team.getId())
// team killer, lose point
%this.incScore(-1,-1);
else
%this.incScore(-1,0);
}
else
%this.incScore(-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::onRemove(%this)
{
}

// Based on old GameConnection incScore function -- moved here for ai
function Tank::incScore(%this,%delta,%deltaTeam)
{
%client = %this.client;

// handle floor on score
if (-%delta>%client.score)
{
%client.cumScore -= %client.score;
%client.score = 0;
}
else
{
%client.score += %delta;
%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;
}
}
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client);
if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());
}
function Tank::incScore(%this,%delta,%deltaTeam)
{
%client = %this.client;
{
%client.score += %delta;
%client.cumScore += %delta;
}
//remove these lines for Survivor
if (isObject(%client.team))
{
{
%client.team.score += %deltaTeam;
%client.team.cumScore += %deltaTeam;
}
}
//END REMOVE LINES, next lines can be used to display messages when scores change.
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client);
if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());

}

 

So where am I going wrong? I mean I did put it at the bottom of theb tank2.cs file. Do I put a space between the new code and the last part of the ORIGINAL tank2.cs code?

Thanks any help would be great DJ Wings! :)

-CUC-

 

- b20

Last edited: Thursday, July 07, 2005 at 6:45:06 PM

Thursday, July 07, 2005 at 6:32:27 PM
b20

Oh wait! XD

Do I just get rid of all these lines here?

 

// handle floor on score
if (-%delta>%client.score)
{
%client.cumScore -= %client.score;
%client.score = 0;
}
else
{
%client.score += %delta;
%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;
}
}
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client);
if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());
}

 

Thanks again!

-CUC-

 

- b20

Thursday, July 07, 2005 at 6:44:22 PM

Wrong... You forgot something

 

                                        
function Tank::incScore(%this,%delta,%deltaTeam)
{
%client = %this.client;
%client.score += %delta;
%client.cumScore += %delta;
//remove these lines for Survivor
if (isObject(%client.team))
{
%client.team.score += %deltaTeam;
%client.team.cumScore += %deltaTeam;
}
//Next lines change what is shown in the playerlist - You can use them to show a message when someone scores
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client);
if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());
}

 

 


Last edited: Sunday, July 10, 2005 at 5:18:45 AM

Friday, July 08, 2005 at 7:04:32 AM

Well, you did the same :)
you removed the if and left the brackets, I just left one bracket, my mistake... I'll edit it


Friday, July 08, 2005 at 7:19:49 AM
b20

Boy this is getting way to confusing for me. :P

-CUC-

- b20

Friday, July 08, 2005 at 10:56:05 AM
b20

Ok so one more double check and maybe I'll get it right this time:

Ok so remove these lines...

 

// Based on old GameConnection incScore function -- moved here for ai
function Tank::incScore(%this,%delta,%deltaTeam)
{
%client = %this.client;

// handle floor on score
if (-%delta>%client.score)
{
%client.cumScore -= %client.score;
%client.score = 0;
}
else
{
%client.score += %delta;
%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;
}
}
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client);
if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());
}

 

And replace it with the codes that Art Crazy gave?

Thanks again!

-CUC-

 

- b20

Friday, July 08, 2005 at 7:31:08 PM
b20

I tried it and it worked, but you can't even hear ANYTHING! When you change it back to the original all the sounds are back.

Here is a screenie of the negative numbers:

Art Crazy can you fix the "not hearing anything" problem from the script you made for nagative numbers? Oh and also only the host doesn't hear ANYTHING. The other players that join the game do hear their normal ThinkTanks sounds.

-CUC-

 

- b20

Friday, July 08, 2005 at 8:40:58 PM

Well, I dont have a problem with that, I ussually play TT with my speakers off anyway

 

 

 

 

Friday, July 08, 2005 at 10:25:14 PM

Well, its not from my script, you sure you didnt change anything else? It works perfectly with sound here, were you running dedicated on non-dedicated (as I had sound problems on non-dedicated before)


Sunday, July 10, 2005 at 4:59:42 AM

CUC-
If you have windows, heresd a salution to all ur problems:
GET A MAC! XD

Sunday, July 10, 2005 at 8:40:31 AM
b20

Well I freaked out since when I put Art Crazy's script in my tank2.cs all Team Battlemode games were MUTED. Oh well now it's all fixed and got rid of the script. Can anybody else launch their server that has negative numbers? :P

-CUC-

- b20

Sunday, July 10, 2005 at 10:20:20 AM

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