What does it do?
This plugin allows you to enable the survivor upgrades in Left 4 Dead. By default, they are given out as follows:
- Laser sight is automatically given.
- At the start of a round, 3 random upgrades are given to each player.
- When a witch is killed, 1 random upgrade is given to each player.
- When a witch is killed, if someone was recognized as the primary attacker, that one player gets 1 random upgrade.
- When a tank spawns, 1 random upgrade is given to each player.
- When a tank is killed, 1 random upgrade is given to each player. (Note: Does not appear to work during a finale.)
- When a tank is killed, if someone was recognized as the primary attacker, that one player gets 1 random upgrade.
Also, as some players do not like the laser sight, if the cvar to automatically give it is set, they can turn it on, off, or toggle it with /laseron, /laseroff, /laser, respectively.
I've also hidden most (if not all) of the text printed out by the upgrade system by default, replacing it, when appropriate, with my own text.
Finally, you can use /listupgrades to list what upgrades you currently have.
Config
surup_verbosity
- How much text output about upgrades players see (0 = none, 3 = max, default is 2).
surup_always_laser - Whether or not we always give survivors the laser sight upgrade. (Default 1 (on))
surup_upgrades_at_spawn - How many random upgrades to give survivors when they spawn. (Default 3)
surup_upgrades_at_witch_kill_killer - How many random upgrades to give survivors when they personally kill the witch. (Default 1)
surup_upgrades_at_witch_kill_all - How many random upgrades to give survivors when their team kills the witch. (Default 1)
surup_upgrades_at_tank_spawn - How many random upgrades to give survivors when a tank spawns. (Default 1)
surup_upgrades_at_tank_kill_killer - How many random upgrades to give survivors when they personally kill the tank. (Default 1)
surup_upgrades_at_tank_kill_all - How many random upgrades to give survivors when their team kills the tank. (Default 1)
For disabling various upgrades, you can use:
surup_allow_kevlar_body_armor, surup_allow_raincoat, surup_allow_climbing_chalk, surup_allow_second_wind, surup_allow_goggles, surup_allow_hot_meal, surup_allow_laser_sight, surup_allow_combat_sling, surup_allow_large_clip, surup_allow_hollow_point_ammo, surup_allow_knife, surup_allow_smelling_salts, surup_allow_ointment, surup_allow_reloader
(0 = disabled, 1 = randomly awarded, 2 = given at round start)
By default, they are all on except for laser and hot meal. Laser is because you get it automatically, and it would be nice not to give it out to someone who used /laser to remove it. Hot meal is because, in testing for Versus, it seemed the only truly unfair one - the 150 health total translated into points, which the other team might have no way to beat.
Translation File
User Mecha the Slag has contributed a replacement english translation file for Left4Dead that replaces the missing instructor strings with valid values. It will only help you with your own client - it is not downloaded by the game. If you want to use it, download the attached file, translation_file.zip, and extract the left4dead_english.txt inside it into your left4dead/resource directory.
Credits
Thanks to everyone on this alliedmods.net forum. I was able to build this much faster thanks to everyones examples. l4dmmo.sp was, of course, the foundation of all the upgrades. Thanks again to Mecha the Slag for the translation file.
Change log
1.0 - 6/22/09
-Initial release
1.1 - 6/23/09
- Filtered out #L4D_Upgrade_laser_sight_expire text broadcast when turning off a laser.
- Added cvars to allow disabling of specific upgrades. (Hot Meal is disabled, by default.)
- Added verbosity cvar. 0 for no messages, 1 for expire events only, 2 for expire events and short self messages, 3 for everything. (Default is now 2.)
- Added potential fix for bots taking over for players getting upgrades.
1.2 - 6/25/09
- Filtered out #L4D_Upgrade_laser_sight_expire for real this time...
- Filtered out #L4D_NOTIFY_VOMIT_ON when a survivor with a raincoat was vomited on.
- Added code to deal with multiple tank_spawn events being generated. If this event occurs twice within 15 seconds, only the first event will grant upgrades.
1.3 - 6/28/09
- Fixed bug in the error message displayed if someone with every upgrade were to get another. (Thanks Number Six)
- Added incendiary ammo upgrade.
- Changed addUpgrade, giveRandomUpgrade, and removeUpgrade to be targeted, per tommy76's suggestions.
- Changed giveRandomUpgrade to giveRandomUpgrades, which now takes how many upgrades to give as a parameter.
- Changed addUpgrade, giveRandomUpgrade, and removeUpgrade to go through the rest of the mod's calls, rather than directly applying an upgrade. (Prevents things like getting an upgrade twice.) This also changes the index values to 1 to 15.
- Setting the allowed cvar for an upgrade to 2 will make it so that it is automatically given out to survivors at the start of a round. (Thanks again to tommy76.)
1.4 - 6/28/09
- Added colors to text messages (Thanks to Mecha the Slag)
- Fixed bug with incendiary ammo that occured in most games. (Thanks for the log, Number Six)
- Fixed logic error in random upgrade selection that made the last two upgrades very unlikely to be picked. (Thanks for the report, Sirenic.)