What it does:
Reads a list of keyvalues containing cvar name, as well as increase/decrease to apply, and applies them according to which team is survivors (generally to assist the losing team in VS). Will also print out to chat explaining how much handicap has been applied. Also contains a list of 3rd party mutations in sourcemod\data\l4d2_mutations.txt to allow support of non-standard game modes.
CVAR/Command list:
The max score difference to consider
l4d2_vshc_scoredifference "500" //When the score difference is this high, 100% of the handicap is in effect.
l4d2_vshc_limit "1.0" // the limit of the handicap multiplier.
l4d2_vshc_CoopRealismMapPoints "75" How many points a map is worth in coop or realism
l4d2_vshc_allowedgamemodes "versus,mutation12,mutation13,mutation15,comm unity6,scavenge" //Game Modes that the handicap will attempt to run in
l4d2_vshc_gascanpoints "40" //How many points a single gas can is worth in scavenge
l4d2_vshc_showtoplayers "3" //Enable or disable round start chat printout and sm_agd command, 1 = agd command only, 2 = start chat only, 3 = both
With the limit, if you set it to 2, then dynamic handicaps can exceed 100%. For example, with l4d2_VSHC_scoredifference =500 and L4D2_VSHC_limit =2.0, if the score difference is 1000+ then 200% of the handicap will be applied. It is a way to scale the limits without having to add insanely high values to the config files.
Static handicaps are an "all or nothing" thing, once past the specified score difference, the entire change is applied.
Examples are in the attached kv_l4d2_versus_handicap.cfg file.
Changelog:
2013-07-20 (0.7.1)
- Removed a debug command
- Cleaned up code, moved several functions to using returns rather than direct value assignments
- Added in some extra error detection for file parsing. If an error is found a message should now be written to the error log, if possible, the plugin will try and continue.
2013-07-20 (0.7)
- Now requires gamemodes.inc to compile.
- Support for different game modes:
- Coop: each successfully completed map is worth an amount of points, set this using the l4d2_vshc_CoopRealismMapPoints cvar.
- Survival (primarily versus variants): After each set of two rounds, times are compared, and then the difference is multiplied by l4d2_vshc_survivalsecondspoints to give a handicap on the next set of two. If you use this as part of regular survival, you will run into a constantly fluctuating difficulity, I will eventually change the behaviour in default scavenge, but for now, I would suggest not using this plugin there.
- Scavenge: Each can is worth a configurable number of points using the l4d2_vshc_gascanpoints cvar.
- There is a new cvar to control what game modes the aggressive director is active on, l4d2_vshc_allowedgamemodes. It is a string containing all wanted game modes, separated by a ",". Default is "versus,mutation12,mutation13,mutation15,comm unity6,scavenge".
- Configurable extra mutations support using sourcemod\data\l4d2_mutations_list.txt
- The format to add a new mutation to the file is “Mutation name,base game mode”. So for example, adding the line
versuscoop,versus
- would let the plugin know that the versuscoop mode uses versus scoring.
- I have included a list of the 192 mutations from raymans mutation mod in in the default file. Add the mutation name to the l4d2_vshc_allowedgamemodes to enable it in that mutation
- Changes to tank health detection printout to work correctly with coop difficulty modes. May still be inaccurate in some cases.
- Moved to using a game rules call for detecting if the teams are flipped.
- Updated the game data file for the steampipe update.
2013-05-11 (0.6.3)
- Fixed a bug with the round start printout after updating for tank health detection
2013-05-08 (0.6.2)
- Added in code to make tank health display correctly( 1.5 * the cvar value in versus)
2013-04-29 (0.6.1)
- Now moved to using SDKCall to read team scores, as such, Left4Downtown2 is no longer required.
2013-04-27 (0.6)
- Added static handicaps, these are applied only above a specified score difference
- To declare a buff as static, use the key value "KV_DynamicBuff" with the value "false" (example in attached kv_l4d2_versus_handicap.cfg)
- To specify the score difference required for the static buff, set the key value "KV_DifferenceNeeded", static buffs will only be shown when active, if set to show.
- If there is no KV_DifferenceNeeded specified for a static buff, it will use the value of l4d2_VSHC_scoredifference.
- Added in cvar l4d2_vshc_showtoplayers, works the same way as invidiual cvars (1 = enables sm_agd command, 2 = enables round start printout, 3 = enable both) to enable/disable chat printout and panel globally
- If l4d2_vshc_showtoplayers = 1, then the command will still be shown to players at the start of the round.
- You can now set boundaries for dynamic handicaps, configured using the key values "KV_WinBoundry" and "KV_LoseBoundry" (0 to disable). Limits that particular buff from exceeding the specified amount (useful if you allow the handicap to go above 100%)
- Due to static handicaps being present, I have changed how all handicaps are applied/removed. You can now specify the same cvar multiple times, for example, once as a dynamic handicap, then again as a static handicap (or multiple times), and all will work independently of each-other, getting added/removed as necessary.
- New kv_l4d2_versus_handicap.cfg attached with examples of different possible configurations
2013-04-25 (0.5)
Well, I finally decided to do a bit more to it, mainly in regards to getting the information out to players, so they can get a good idea of what is going on.
- Renamed from l4d2_vsbalancer to l4d2_versus_handicap/Agressive Director
- Cleaned up team detection code, less redundant checks.
- Changed cvar l4d2_maxscorediff to l4d2_VSHC_scoredifference
- New cvar L4D2_VSHC_limit sets a limit on the handicap miltiplier
- Now prints out to chat selected changes at the start of a round (configured in KV_L4D2_Versus_Handicap_.cfg)
- New command sm_agd can be used to display a panel of selected values
- New command sm_agd_reload to reload the keyvalues file
- New option stored in the keyvalue file KV_ShowToPlayers, when at 0, will never show, 1 means show in sm_agd panel, 2 means show in round start info, 3 means show in both (defaults to 0)
- The section name of the keyvalues is now the printed name to chat/panel.
2012-04-07(0.4.5)
- Updated team detection to avoid conflicts with mods that change the order of play
- Now requires both left4downtown2 and sdktools, as well as the l4d2_vsbalancer_gamedata.txt file (placed in sourcemod\gamedata), based off of the gamedata file from the L4D2 score/team manager plugin
2012-04-06(0.4.4)
- Fixed a bug with round 2 infected getting properties of round 1 infected on first spawn
- Provided a new example VSBalancer.cfg file, it modifies a lot more cvars now.
2012-03-26(0.4.3)
- Added a modifiers applied check to OnMapEnd modifier removal.
2012-03-26 (0.4.2)
- Re-wrote the team detection and cvar modify apply/remove, it now waits 5 seconds after map start, then detects first team based on higher campaign score, then applies the appropriate balancer, then on round end, changes it over to apply the opposite changes for the 2nd team, then at the 2nd round end removes the changes, setting all cvars back to what was detected 5 seconds after map start.
2012-03-24 (0.4.1)
- Updated team detection code so that the score loop is only needed for the first team.
- New con var l4d2_vsbalancer_version for tracking what version the plugin is
- changed cvar l4d2_maxscorediff to have FCVAR_NOTIFY
2012-03-22 (0.4)
- Moved to using a keyvalues file to store data on what cvars to change and how much (example attached)
- Code cleanup
- Removed extra Cvars from changing to keyvalues
- Added on plugin end so when plugin quits, all changes are undone
- Change as suggested by disawar1
2012-03-19 (0.3)
- Added in code to reduce the spawn time for the losing team
- Added in code to increase common HP when winning team is survivors, and decrease it when losing team is survivors
- More code cleanup
2012-03-19 (0.2)
- Moved to using handles and SetConVarInt compared to constantly calling FindConVar and ServerCommand
- Cleaned up the code a bit (no more nested nested nested if statements)
2012-03-18 (0.1)
Installation instructions
Please make sure you have an appropriatly formatted keyvalues "kv_l4d2_versus_handicap_.cfg" config file in your addons\sourcemod\config folder, and have placed L4D2_Versus_Handicap_gamedata.txt in your sourcemod\gamedata folder. As well as the included l4d2_mutations_list.txt in your sourcemod\data\ folder.
Dependencies
Requires
gamemodes.inc to compile.
Plans (grain of salt required, been a year since my last update)
Better support for Survival game modes that are not PvP.