r/TagPro • happy • Aug 20 '14

[Userscript] Fair Teams

Link

This userscript has three, independently disable-able features related to fair teams:

  1. Automatically switch teams when the usual conditions are met: your team has 2 or more additional players (eg. 4v2 3v1) OR your team has 1 additional player and is winning. I've also added the additional constraint that you aren't currently carrying the flag***.
  2. If the above constraints aren't met (or if you've disabled the feature), and the other teams has fewer players the entire screen will be slightly tinted to warn you that the teams are unfair. An example scenario for when this might occur is if its 4v3 but the game is tied, or even 4v2 and other other team is winning.
  3. If the same conditions are met as in feature 1 but in favor of the other team, you can automatically request "can someone switch teams" in chat. I've limited the number of requests per game to 1.

I've also found a small bug. It seems that if you attempt to switch teams while spawning you won't switch, but you still see "[name] has switched to the blue team" in chat without actually switching teams.

CONCERNS: Using auto switching has made me realize just how often people quit mid-game. I end up switching teams very frequently. Its not uncommon to switch twice in one game. Maybe I should delay the switch to wait for others to join before switching? and/or limit switching to once per game?

***Not sure if this is the best constraint. Perhaps instead the constrain should be that both flags are in base. thoughts?

13 Upvotes

11 comments sorted by

View all comments

Show parent comment

2

u/happytagpro happy Aug 21 '14

its definitely not the only way, but so far I havent had any trouble with it not working. AnkhMorpork's method (from his TagPro Speech userscript that you pm'd me) would probably work, but seems unnecessary since it runs 10 times every second and checks every player. I only need to know if my ball doesn't have the flag, so i only need to check tagpro.players whenever a loss of flag possession occurs (drop or score).

1

u/TagProR3KT <:[ R3KT ]:> || Centra || ( ͡° ͜ ͡°) ♛♚♜ЯƸƘŦ♜♚♛™ ( ͡° ͜ ͡°) Aug 21 '14

just wondering