Release Teambalance routine change
#1
Hey,
here is a mini release of a teambalance mod i just made, because some people wanted the teambalance routine to be changed...
It chooses the player with the lowest "session time" on the server instead of the player that has been on the team the shortest ammount of time.

BTW: timePlayed["total"] only gets counted up if you are on axis or allies not for spectators ;D.

go to _teams.gsc and search for the balanceTeams() function and change it to:

Code:
balanceTeams() { iPrintLnBold( game["strings"]["autobalance"] ); //Create/Clear the team arrays AlliedPlayers = []; AxisPlayers = []; // Populate the team arrays players = level.players; for(i = 0; i < players.size; i++) { if(!isdefined(players[i].timePlayed["total"])) continue; if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies")) AlliedPlayers[AlliedPlayers.size] = players[i]; else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis")) AxisPlayers[AxisPlayers.size] = players[i]; } totalTime = undefined; while((AlliedPlayers.size > (AxisPlayers.size + 1)) || (AxisPlayers.size > (AlliedPlayers.size + 1))) { if(AlliedPlayers.size > (AxisPlayers.size + 1)) { //(OLD) Move the player that's been on the team the shortest ammount of time (highest teamTime value) (OLD) //Move the player that's been in the server for the shortest amount of time (lowest timePlayed value) for(j = 0; j < AlliedPlayers.size; j++) { if(isdefined(AlliedPlayers[j].dont_auto_balance)) continue; if(!isdefined(totalTime)) totalTime = AlliedPlayers[j]; else if(AlliedPlayers[j].timePlayed["total"] < totalTime.timePlayed["total"]) totalTime = AlliedPlayers[j]; } totalTime [[level.axis]](); } else if(AxisPlayers.size > (AlliedPlayers.size + 1)) { //(OLD)Move the player that's been on the team the shortest ammount of time (highest teamTime value) (OLD) //Move the player that's been in the server for the shortest amount of time (lowest timePlayed value) for(j = 0; j < AxisPlayers.size; j++) { if(isdefined(AxisPlayers[j].dont_auto_balance)) continue; if(!isdefined(totalTime)) totalTime = AxisPlayers[j]; else if(AxisPlayers[j].timePlayed["total"] < totalTime.timePlayed["total"]) totalTime = AxisPlayers[j]; } totalTime [[level.allies]](); } totalTime = undefined; AlliedPlayers = []; AxisPlayers = []; players = level.players; for(i = 0; i < players.size; i++) { if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies")) AlliedPlayers[AlliedPlayers.size] = players[i]; else if((isdefined(players[i].pers["team"])) &&(players[i].pers["team"] == "axis")) AxisPlayers[AxisPlayers.size] = players[i]; } } }

Or just download the attachment.

Virustotal: https://www.virustotal.com/file/26ce761c...341933812/


Attached Files
.zip   z_teambalance(extract!).zip (Size: 4.36 KB / Downloads: 48)
[Image: lxkf2.jpg]

#2
Very good practical use. +1.

#3
very nice, i like this better than the old routine, just seems more reasonable to the players that have been in the server the longest, plus keeps the team balance happening without changing rounds! +1

#4
I suggest you move the first n players who die, I hate when teambalance kill me while im in a row!
My Reputation is low, help me with +1 rep if i helped you! Big Grin



Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 10,850 08-06-2013, 06:28
Last Post: 14th
  Mw3 Feed Color Change?? aluzion 5 7,839 07-16-2013, 19:52
Last Post: barata
  Change death animation Keouf 3 5,652 07-05-2013, 18:39
Last Post: Nekochan
Question Help change single file lzma maker to multiple in c# raminr63 1 4,076 05-12-2013, 19:31
Last Post: raminr63
Information How to change text messages in MP (.ff edit) giofrida 5 7,121 05-02-2013, 20:05
Last Post: Pozzuh
  i want change mod to .iwd file ABDULMAILK 7 8,490 03-10-2013, 05:24
Last Post: DidUknowiPwn
Question Change Valkyrie Rockets to a Predator Missile Style? PMac18 1 3,827 01-18-2013, 06:15
Last Post: PMac18
  HOW I CAN CHANGE TEAMS NAME? s.j-rez 12 13,721 01-03-2013, 19:49
Last Post: zuiopas1
  Se7en's name change Pozzuh 31 21,270 12-13-2012, 20:07
Last Post: JariZ
  [Request] Team change by admin command. Dumas 10 11,533 11-29-2012, 21:38
Last Post: 99IRock

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.