Auto Team Scrambler
v. 1.5.3
Foreword : here is version 2, which works for CS:S/GO+DoD:S, but it is not stand-alone (does relate on another plugin). That version 2 comes with an interface that allows manual intervention in the team scrambling process. It is also why I can't present the number of servers with this plugin anymore.
Introduction/Features :
Tired of unbalanced teams during the whole map? You want people to be able to play with different teamates on the same map (also works with jailbreak-like)? That is how this plugin become useful. It is all about team scrambling (NOT balancing). This means fun situation can happen, but it can also be used to break "imba" teams.
This plugin scramble teams
at round end when certain situation are met.
Currently the three following "rules" are possible :
- Round scrambling - Scramble teams every X rounds.
- Bestof scrambling - Scramble teams when a team reaches X win.
- Winstreak scrambling - Scramble teams when a team keeps winning without losing (I believe this option is preferable over the two others if you want to keep your server rather normal, but preventing teams to always win).
Do note that the three above "rules" can work together. It does also generate a lot of verbose, so you might want to change verbose CVars and take less "rules" possible.
Teams' scores are by default reset to 0 everytime there is a team scramble, however that can be avoided (CVar ats_real_score; I believe you'll want to remove that option if you're using roundlimits).
Finally, you might want to use this plugin with a team controller plugin (to avoid people switching teams themselves). i.e. :
http://forums.alliedmods.net/showthread.php?p=521116.
EDIT : Since 1.3.0 a random sound can now be played when teams are scrambled (need to put ats_sound's value to 1). They won't be downloaded if they are disabled (and they are disabled by default).
EDIT #2 : I highly suggest you to set mp_autoteambalance 0, mp_limitteams 0 and mp_teams_unbalance_limit 0 to prevent any conflict with my plugins.
Known bugs :
CVars :
- autoteamscrambleversion: Gives version -_-'
- ----------
- ats : Is the plugin enabled? 0 = disabled, 1 = enabled (fair team), 2 = enabled (possible unfair, i.e. 12v5), 3 = for custom maps (i.e. jailbreak 2vALL). Def. 1.
- ----------
- ats_rule_round : Frequence (in round) of team scrambling. 0 = disabled, 1+ = enabled. Def. 0.
- ats_rule_bestof : Scramble when a team win a best-of-X (odd number recommended; even will go with an additionnal round; i.e. 4 -> 5). 0 = disabled, 1+ = enabled. Def. 0.
- ats_rule_winstreak : Scramble when a team win X victories in a row. 0 = disabled, 1+ = enabled. Def. 4.
- ----------
- ats_verbose_score : Tell players the score after every rounds. 0 = disabled, 1 = enabled (Default).
- ats_verbose_rule : Tell players every X rounds how team can get scrambled. 0 = disabled, 1+ = enabled. Def. 1.
- ats_verbose_scramble : Tell players when team are scrambled. 0 = disabled, 1 = enabled (Default).
- ----------
- ats_sound : Play a sound when teams are scrambled. 0 = disabled, 1 = enabled. Def. 0. If set to 0 sounds won't be downloaded.
- ----------
- ats_real_score : Reset team scores when scrambling teams (recommended for timelimits only). 0 = disabled, 1 = enabled (Default).
- ----------
- ats_required_value : If CVar 'ats' value is '3', then a team will have X players. Min 1.
- ats_required_team : If CVar 'ats' value is '3', then specified team will have an exact number of players. 0 = terro, 1 = CTs.
- ----------
- ats_delay : Time in seconds before round start when team will be scrambled. Default 0.1 ; meaning slightly before round start.
- ats_blockdmg : If damage is blocked between scrambling and round start. 0=no, 1=yes (default).
- ----------since 1.5.0----------
- ats_fade : Fade-in players screens when teams are scrambled. 0 = no, 1 = yes (default).
- ats_fade_duration : Duration of the fade-in. Best values are around 250-1000. Def. 500.
--------------
Any
suggestions/comments on the code or the plugin are
welcomed and
appreciated.
Changelog :
- 1.0.0 Initial release. (03-07-2011)
- 1.1.0 (06-07-2011)
- Fixed bug where draw games (pre-1st round end & map end) would generate verbose & a game count. Thanks to Bacardi for reporting.
- Fixed bug where verbose wouldn't be show due to low value of CVar "mp_round_restart_delay". Thanks to Bacardi for reporting.
- 1.1.1 Fixed bug where spectator and teamless players would be teamscrambled. Thanks to Bacardi. (07-07-2011)
- 1.1.2 Fixed translations code (some phrases could be in another language). Thanks to Bacardi. (07-07-2011)
- Added norwegian translation. Thanks to leetgamer. Also removed some double-space in phrases. (08-07-2011)
- 1.2.0 If CVar "ats" value is '3', a mode for custom maps (i.e. jailbreak) will be enabled and a team (specified by CVar "ats_required_team") will have a specific number of players (specified by CVar "ats_required_value"). (10-07-2011)
- 1.2.1 Fixed teams being scrambled on game end (in CS : S, only for timelimit, since mp_maxrounds need to spawn players to trigger map end). (10-07-2011)
- 1.3.0 Added support for optional sounds; a random one can be played when teams are scrambled (at the beginning of the round to be exact). New CVar "ats_sound" (default sounds are disabled = 0). I'm using custom sounds since I want my plugin approved (so I can't put awesome TF2 sounds "teamscramble02.wav" nor "teamscramble03.wav"; but I hope you look around for better sounds ;) ). (20-07-2011)
- 1.3.1 Corrected 3rd mode (ats 3). Also corrected 3rd-mode related CVar descriptions (minimum --> exact number). It should now always put the exact number of people in the team. Big thanks to namine who get me to work on it & report the bug. Changed a dynamic array to static array. (11-08-2011)
- 1.4.0 (13-08-2011)
- You can now choose when you want teams to be scrambled. See CVar ats_delay.
- Players can no longer get killed during the time between team scrambling and round start. Only exception is bomb explosion. See CVar ats_blockdmg.
- SDKHooks is now needed to compile.
- 1.4.1 Added FCVAR_DONTRECORD flag. This means the config file the plugin creates won't contain the version number anymore. (24-02-2012)
- 1.5.0 (10-03-2012)
- Added a fading color at the beginning of the rounds when teams get scrambled. It is on by default. See CVar ats_fade and ats_fade_duration. Was requested by "Shit on shoe".
- Clarified a log message (when using differents sounds; if it fails to find one).
- Cleaned a bit code (comments++, scoped a global var.).
- 1.5.1 Corrected crappy scrambling when a team has a fixed amount of players (i.e. 2vALL). (01-07-2012)
- 1.5.2 Changed the way the end-game-scrambling-prevention works so it is more robust (KillTimer apparently brought some rare bug, having TIMER_FLAG_NO_MAPCHANGE flag concurence the "cs_win_panel_match" event sometimes...). Thanks to KyleS. (12-07-2012)
- Approved by KyleS. Thanks. (06-10-2012)
- 1.5.2b Little optimization : turned one FormatEx into strcopy. (06-10-2012)
- Removed the version CVar for this thread, as AM now enforce 1pluginthread-1versioncvar rule = (╯°□°)╯︵ ┻━┻). (27-12-2012)
- 1.5.3 (28-12-2012)
- Fixed bug where mp_restartgame wouldn't reset winstreak.
- Fixed bug when using 1+ other rule with ats_rule_round.
- Removed FCVAR_REPLICATED from version ConVar.
- Removed FCVAR_NOTIFY from non-version ConVars.
- Reverted from [Any] to [CSS], since my code wasn't intended to work on CS:GO anyway (:$). See ATS 2 for a CSGO-capable version.
How to install sounds :
Extract "ATSsound" at your cstrike folder...
- "ats1.wav" and "ats2.wav" should now be in "sound/misc".
- Have CVar "ats_sound"'s value to "1".
- ----------
- Don't hesitate to replace them by your own sounds ! (Visit http://www.tf2sounds.com/ for more interesting sounds ).
- You can add up to "ats9.wav" for more randomness.
- Do know that there needs to be a "ats1.wav" to use a "ats2.wav", a "ats2.wav" to use a "ats3.wav" and so on (max 9 sounds; 1 to 9).
- ----------
- If you want to compile the plugin yourself, you'll need SDKHooks
Todo list :
Credits :
- Bacardi for bug reporting (1.1 & 1.1.1 & 1.1.2 & 1.2.1).
- leetgamer for norwegian translation.
- Bakr for testing without bots 1.2.0.
- Darkclaw Deathstrike and XxXworlockzXxX for their sounds (1.3.0) on GameBanana (respectively here and here)
- namine for reporting about 3rd-mode bug (1.3.1).
Other notes :
- I couldn't play the sound before the beginning of the round; because it would be played over 2 rounds; and since ALL sounds are reset at Roundstart, I can't do that.
- There can be map with not enough spawn points... so you might want to use map specific configs.