Forums Index >> Modding >> Auto Balance Script™



Page : <1> :


Ok. If many you have seen Roo's unfair teams thread, you should know what I'm talking about. The idea of this script is when the teams are unfair the game will make them fair. Can this be done?


Tuesday, August 02, 2005 at 5:56:26 AM

What do you mean?
Randomize people? –> I might be able to do that

Tuesday, August 02, 2005 at 11:12:42 AM

I know that Art has a script for randomly balancing teams. I might be able to do it if I had time...

Last edited: Tuesday, August 02, 2005 at 8:50:21 PM

Tuesday, August 02, 2005 at 8:49:37 PM

What you all could do is to, when someone joins, put them on the team with less players, or randomly if the teams are even... (remember the should also be evened :P)


Wednesday, August 03, 2005 at 5:38:58 AM

But remember Ac, some people are better than others... Is there a way that you can alternate their teams by their score ??

 

 

 

 

Wednesday, August 03, 2005 at 6:26:22 AM

Ya mean something like:

If(%client.incScore >= 10);
%client.team= "blueteam";

Thursday, August 04, 2005 at 6:15:51 PM

Yeah!

 

 

 

 

Thursday, August 04, 2005 at 7:45:11 PM

Yeah But Where Shall We Add That Line? ;)

HaHa ^^ You Just Got p00ne1) WanT SoMe MoRe?? 1v1 You Host It.

Thursday, August 04, 2005 at 9:08:46 PM

In around 3 weeks I'll start working on it, if it still hasn't been made :)


Friday, August 05, 2005 at 5:24:21 AM

@art psyco

 


In around 3 weeks I'll start working on it, if it still hasn't been made

 

Just Shut Up!!!!

@Cool: it will need to go in a script, but what about a code?
/balance

EDIT: took me 5 mins. Didnt test it

Function balance(%sender)
{
if(!ClientisAdmin(%sender,"Why even think of trying, you are not admin"))
return;

$len = clientgroup.getCount();
for(%i=0; %i<$len; %i++)
{
%client = clientgroup.getObject(%i);
if(%client != -1)
if(%client.incScore <= 10 && %client.incScore >= 6)
{
%client.team= "greenteam";
}
else if(%client.incScore <= 5 && %client.incScore >= 0)
{
%client.team= "blueteam";
}
else if(%client.incScore <= 20 && %client.incScore >= 11)
{
%client.team= "greenteam";
}
else if(%client.incScore >= 21)
{
%client.team= "blueteam";
}

}
}

Last edited: Friday, August 05, 2005 at 9:16:12 AM

Friday, August 05, 2005 at 8:56:30 AM

@^
Ok, first, I'm on vacation and can't work on those scripts cos I dont have all my utilities here, second, your script wouldnt shuffle bots, third, look at this:

Imagine the scoreboard would be all tied with 1 everybody would go into the blueteam!

Oh, and fourth, reread your script and check for syntax errors...
And now fifth, they were trying to get it shuffle AUTOMATICALLY when the game starts, so you shut up XD

@Rest
Well The way it woul have to be is to collect all the scores into a database, then go from lower to highest, giving a team, like there was a person with 0, another with 1, another with 2 and another with 3
The script would then random the starting team, put the person with 0 on the starting team, person with 1 in the other team, person with 2 in the starting team too etc...
If there were like 5, 7,9 ppl, the extra person would go to the starting team to even out it starting out with the lowest person...


Friday, August 05, 2005 at 12:25:38 PM

Art Crazy ur so mean u think u know everything why wont you Shut Up :) XD Ur So Mean Man saying SHUD UP

HaHa ^^ You Just Got p00ne1) WanT SoMe MoRe?? 1v1 You Host It.

Friday, August 05, 2005 at 4:45:19 PM

Here is a VERY detailed explanation!

SCOREBOARD

1. Pedro - 10 points
2. Art Crazy© -10 points
3. Spark - 8 points
4. CoolBoySF - 7 points
5. Posiden - 6 points
6. FredTank - 6 points
7. Bolo - 5 points
8. Tally Ho - 2 points
9. Scytheman - 0 points
10. LONEWOLF(UF) - 0 points

That above is the scoreboard AFTER a game, now while the next game is loading this happens!

Pedro - Blue team
Art Crazy© - Green team
Spark - Blue team
CoolBoySF - Green team
Posiden - Blue team
FredTank - Green team
Bolo - Blue team
Tally Ho - Green team
Scytheman - Blue team
LONEWOLF(UF) Green team

That above is what needs to happen !!

Now thats sorted crack on with it ! ;)

 

 

 

 

Friday, August 05, 2005 at 5:41:25 PM

@Fart Lazy:

 


took me 5 mins. Didnt test it

 


1. Im working on ANOTHER specially ordered script. I didnt have time too check it (this was the blueprint)
2. What do you use to make scripts? TGE? I USE TEXT EDIT!!!!!
3. Bots you say? EASY:

 


$len = bot clientgroup.getCount();
for(%i=0; %i<$len; %i++)

 

 

Friday, August 05, 2005 at 5:45:33 PM

@TheFart3
1. Well, I'm working on at least 3 other scripts, (not really, I havent got my research tools here, as I'm on holiday) one of them being a gametype, another one with GUI, and the admin script...
2. TGE cant be used to make scripts dummie... It can only be used to compile and run them... I use Tribal IDE... Even if I can easily use notepad... Like the 2 last scripts released on nappy's thread, they were made in 5 min. Each, and only the debugging took a while, as I dont have TT here and I had to do a debugging with napalm testing it and giving me logs, console errors etc...
3. Well you need to edit 2 lines, one of them is that... But you shouldnt use $len, but %len, as $ uses the same memory as %, but $ stays in the memory till TT is closed

@Pedro
Like I said, thats what I want :) (and will make when the holidays end if it still hasnt been made the way we want...)


Saturday, August 06, 2005 at 6:14:50 AM

Stop being lazy, and actually admin your games, dash did it all for you guys...just simply use /mg Name.
Or for the more informed of you, use the code dash gave you to make a script. Simple, I have made a script just like it from what dash gave me alone :) and it works perfectly.

Saturday, August 06, 2005 at 1:12:43 PM

@ (MF)Morfeuz®'

Are you calling people lazy because they cant do something the moment someone has the tiniest whim?
Art has a holiday and he deserves one!
am I lazy because I have a job and dont have time to script much?
others actually have lives outside of TT, and some dont have time to learn

Give credit where credit is due...
people came looking for help, and they are not lazy for not being able to do it themselves....

 

 

 

 

Saturday, August 06, 2005 at 3:47:58 PM

I'm just saying that there is tutorials out there and other ways to get info, no need to go overboard Warfare.

Saturday, August 06, 2005 at 4:32:47 PM

I would like this to make complete random teams, but with the same amount per team.

Sunday, August 07, 2005 at 11:08:28 AM

Uhm, Racer try it with the change team code 10 times inside the function (blueTeam then greenTeam) like so:
%client.team= "blueteam"; then green (5 times each) and change the client score to 0 - but obviously this will have to be done inside a full server of 10 and right at the beginning of the game.
Need anything more, mail me.

Sunday, August 07, 2005 at 12:01:57 PM

Not efficiant and wont effect bots

Make a new function

Try using clientgroup.getcount();
and botclientgroup.getcount();
to change both bot's and client's teams
also, use a variable like %lastTeam to make sure you arnt using the same team over (IE.... Using blue after using blue)

 

 

 

 

Last edited: Monday, August 08, 2005 at 3:34:33 PM

Sunday, August 07, 2005 at 12:29:08 PM

We dont need it to affect BOTs !

Its mainly for late-night scrum games...

 

 

 

 

Sunday, August 07, 2005 at 3:56:39 PM

Exactly my point Pedro, but Warfare is never there, so he wouldn't know what we mean :)

Monday, August 08, 2005 at 4:38:23 AM

Well, Chon.. Ups, Morfeuz, In arround 1 week I'll start working on the script and then release it, happy? I havent got much time for scripting as It has been hot and the beach is worderful XD...
Uh well, its easy to include bots so why not to?

Warfare, the client groups do not include "%"... Bad boy :P


Monday, August 08, 2005 at 5:12:22 AM

Lol, ha!
I wrote that when I was on my way out the door... Sorta rushed XD
thx for pointing that out..anyway.... Edited! :P

 

 

 

 

Monday, August 08, 2005 at 3:35:31 PM

DaBUMP !

 

 

 

 

Friday, August 12, 2005 at 12:35:16 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