View Single Post
Author Message
extrospect
Member
Join Date: Aug 2009
Old 11-30-2009 , 16:23   [L4D2 + L4D] pouncedamage+ - Hunter Uncapping & Modification [+ Stats] v0.9.6
Reply With Quote #1

[pouncedamage+] Hunter Pounce Uncapping & Modification for L4D2 (+ L4D)


This is my first attempt at a full plugin, and I have to give credit to n0limit for his Pounce Announce plugin which I nicked the pounce damage calculation code from to create this .

A few people probably already knew about uncapping pounce damage in L4D with the max, min & damage Cvars - unfortunately Valve decided to steal the max and min cvars from us in L4D2, so you can turn up the damage but not extend the max range.

This plugin solves all that and more , it allows an admin to:
- Uncap the hunter pounce damage limit upto any value they like (anything over 400 is essentially uncapped) while maintaining default damage scaling (unless l4d_pdp_scale (see below) or z_hunter_max_pounce_bonus_damage is set to a non-default value).
- Adjust the scaling of pounce damage relative to default using a single cvar which behaves as a damage multiplier.
- Enable the carry-over & scaling of any excess dmg dealt when pounce dmg incaps a survivor, i.e. a 20 dmg pounce on a 5 hp survivor with an incap scale of 3.0 would deal an extra 45 (3.0 * (20 - 5)) dmg to the survivor once they are downed.
- Adjust various properties of the plugin's notifications as well as having the option of blocking ingame notifications.
- Enable or disable damage scoring for any excess dmg the plugin deals.
- Enable or disable hunter pounce stats tracking.

- Set which game modes the plugin is enabled for.
The plugin also now includes hunter pounce stats with the ability for users to view their own stats and see a top <n> list of the best damage pounces on the server; server average stats are also being collected and will be used in future versions for users to compare their stats to the averages on the server.


Cvars:

l4d_pdp_maxdmg: This value is the damage cap the plugin will enforce, it is intended to be a number above the current/normal damage cap (25), however, setting it below will just result in no extension of the normal cap (currently, the plugin will not limit the dmg below the inbuilt cap, although you can acheive this by increasing pdplus_scale and lowering the ingame & pd+ caps); it can be set to any value, although survivors only have 400 hp from full health thru incapped to dead so using a value over 400 is the same as having no cap. (default 100 [upto 100 dmg can be dealt by a single pounce])

l4d_pdp_scale: This acts as a scaling factor for the damage, so if set to 5 then hunter pounce damage will be 5 times as intense (a normal 20 dmg pounce would now deal 100 dmg), likewise it can be set to a value below 1 (but above 0, e.g. 0.5 to halve pounce damage) to decrease pounce damage - effectively extending how far you need to pounce to deal a given amount of damage. Any positive value should work fine, I tried it with a negative value just for fun and it 'heals' survivors with pounce damage xD, the more damage you land - the more hp the survivors get . (default 1.0 [normal l4d2 pounce damage scaling])

l4d_pdp_incap_dmg: If this is enabled (set to 1), then any excess damage dealt to a survivor who is incapped by pounce damage will be dealt to their downed hp. See above for a better explanation . (default 1 [enabled])

l4d_pdp_incap_scale: Allows scaling of the carry-over damage enabled using pdplus_incap_dmg, e.g. pdplus_incap_scale 3 would mean that if you landed a 50 dmg pounce on a 10 hp survivor, the normal 40 dmg carryover becomes 120 hp, leaving them downed with 180 hp left =). (default 1.0 [carry-over damage is not scaled and is applied as it is])

l4d_pdp_notify: This defines how [pd+] notifications will be shown in chat: 0 - No chat notifications for pounce damage; 1 - Chat notifications for any pounces above the in-game cap (not the plugin cap - pdplus_maxdmg), i.e. the pounces where the victim will experience more damage than the ingame notification can announce; 2 - Chat notifications for pounces equal to or above pdplus_notify_min (see below); 3 - The same as 1, but using hintbox notifications instead of announcing it in chat; 4 - The same as 2, but in a hintbox not chat. (default 3 [hintboxes for over default cap only])

l4d_pdp_scalenotify: If pdplus_scale is changed from default (1.0) then enabling this cvar (set it to 1) causes clients to be notified of the change to the damage scale in chat at every pounce - this helps to prevent confusion over the mismatch between the ingame pouncedamage value that pops up and the actual damage sustained after the plugin has done its thing. (default 1 [enabled])

l4d_pdp_incapnotify: If incap dmg carry-over is enabled then settings this to 1 will inform players whenever it occurs, telling them how much extra damage was done, and to who, once they were down. (default 1 [enabled])

l4d_pdp_gamemodes: Set this cvar to a comma separated list of the gamemodes you want pd+ [including the stats system, if enabled] to be enabled for. e.g. pdplus_gamemodes "versus,scavenge,realism" would enable the plugin for only those gamemodes and disable it for coop, survival, teamscavenge and teamversus. (default "versus, scavenge")

l4d_pdp_notify_min: (Thanks to Blakeocity for the idea ) This allows you to set a min pounce value required to trigger notifications when pdplus_notify is set to either 2 or 4. Only pounces with damage equal to and above the value set will trigger pd+ announcements. (Default 1 [all dp's trigger notifications])

l4d_pdp_notify_all: If enabled (set to 1) then pd+ announcements will be broadcast to all players on the server, if disabled (set to 0), then the announcements will only be sent to the pouncing player and their victim. (Default 1 [enabled])

l4d_pdp_welcome: Enable (1) and disable (0) a welcome message which will be sent to all players who are new to the server through chat about a minute after they connect - the message just explains what effect pd+ is having on this server. (Default 1 [enabled])

*new stuff*

l4d_pdp_dmg_scoring: Enable (1) or disable (0) whether any extra damage dealt by the plugin is added to the attacking hunter's score, this function is currently only able to add to a hunter's score and cannot subtract from it, so if l4d_pdp_scale is set to less than 1.0 then the hunter will score more points (as many as they score by default ingame) than the damage they actually deal. (Default 1 [enabled])

l4d_pdp_block_ingame_dmgtxt: Allows the ingame pounce damage notifications to be selectively blocked; set to 0 to never block ingame msgs, set to 1 to only block the ingame notification if it displays a different dmg value than pd+ and set to 2 to always block the ingame msg if there is a pd+ notification. (Default 1 [ingame msgs are blocked if the dmg they show is not what is actually being dealt])

l4d_pdp_welc_reg_timeout: The number of days before removing non-admins from the welcome register file, this keeps the size of the file down but means players will receive the pd+ info message they get on first connect once again if they rejoin after being deleted. (Default 30)

l4d_pdp_version: Version cvar.


Stats Cvars

l4d_pdp_stats: Set to 1 to enable pd+ stats on the server, likewise set it to 0 to disable stats (doesn't clear the stats file so stats will still be there when re-enabled). (Default 1 [enabled])

l4d_pdp_min_visits: The number of visits that the stats system must record for a user before moving them from the 'guest' category to the 'regular' category with regards to deletion of stats after x days without a visit (see pdpstats_guest_timeout and pdpstats_reg_timeout below). (Default 3)

l4d_pdp_guest_timeout: After this number of days without a visit, a user who has not had sufficient visits to be considered a 'regular' will have their stats flagged for deletion when the statsfile is cleaned. i.e. how many days til random players' stats are automatically cleared. For each of the timeout cvars, a value of 0 results in the stats never being deleted. (Default 5)

l4d_pdp_reg_timeout: After this number of days without a visit, a user who has had sufficient visits to be considered a 'regular' will have their stats flagged for deletion when the statsfile is cleaned. i.e. how many days til regular players' stats are automatically cleared. (Default 30)

l4d_pdp_admin_timeout: This is how many days without a visit before a user who is flagged as an admin (with priveledges equal to or above the flag set in pdpstats_min_admin) will have their stats automatically deleted. (Default 0 [Never delete admin stats])

l4d_pdp_min_admin: The lowest alphabetical admin flag considered to be an admin with regards to stats deletion, only admins with an access level equal to or above this level will be protected from stats deletion for <pdpstats_admin_timeout> days since their last visit. (Default "a" [users who have reserved slot access and above are considered admins])

l4d_pdp_welcome_msg_default: The default stats welcome message behaviour for new clients, clients are able to change the behaviour later on using !pdpwelcome in chat (see below) but this is just how it will default for people who don't change anything. 0 disables a welcome message, 1 gives a private [client only] welcome message and 2 gives a public welcome message [broadcast to all connected players]. (Default 0 - no stats welcome messages)


Commands

l4d_pdp_clean_statsfile: The stats file is cleaned whenever the server empties or the map restarts, but this is here just incase an admin wants to manually trigger a cleaning of the statsfile, it's a server command so needs to be run as rcon.

l4d_pdp_deleteall: This can be used to completely clear the statsfile of all entries and start afresh. This is also a server command and so needs to be entered as rcon.


sm_pdpstats / l4d_pdp_statsme: Client command (most easily accessed using !pdpstats in chat) that allows the user to check their stats.

sm_pdptop: Client command to display a list of the top <n> personal best damage pounces on the server. Usage is sm_pdptop <n> in console or "!pdptop <n>" in chat, i.e. "!pdptop 55" to see the top 55 p.b.'s.

sm_pdptopdelay: Client command used to set their desired delay between top menu pages. Usage: sm_pdptop <n> to set a specific value or just sm_pdptopdelay to cycle thru defaults, works the same for '!pdptopdelay' in chat.

sm_pdpwelcome: Client command to toggle (or set, if 0, 1 or 2 is entered after the command (i.e. "!pdpwelcome 2" in chat)) how they are welcomed to the server by pd+stats - switches between no welcome (0), a private welcome (1) and a public welcome (2).


Limitations

This plugins does not actually uncap the ingame pounce damage system, it just simulates doing so by calculating how far a hunter has pounced, from that it can work out [based on the standard game damage/distance scaling] how much damage *should* have been done and then it applies the extra damage, to the pounce victim, that the game didn't due to the inbuilt cap (at a pounce of ~1000 distance units).

As a result, any damage above the cap is applied by the plugin, not the attacking hunter. The current damage application system does allow the additional dmg applied by the plugin to be scored but cannot be used to subtract dmg from a hunter's score (i.e. when l4d_pdp_scale is below 1.0). So, if damage is downscaled, hunter's scores will reflect the original ingame dmg despite the survivors being dealt less damage than the score would suggest.


Future improvements:

Include notification options for pdplus_incap_scale.

Break stats keyvalues file into multiple separate files to avoid loading very large keyvalues tables for servers with lots of user stats.

Look into modifying hunter scores in other ways in order to allow subtraction from hunters' scores.

Add a command to let users clear their own stats.

Add more in-depth stats analysis and possibly a menu to split the stats into separate groups.

Add translations.


Changelog:

Version 0.9.6
- Fixed a bug which caused an additional entry into the top <n> menu with a pounce dmg equal to the best on the server under the name 'unnamed'.

Version 0.9.5
- Added the ability to add any extra dmg a hunter scores due to the plugin onto the hunter's score, this can be turned on or off using l4d_pdp_dmg_scoring.
- Added function to block the ingame pounce dmg messages, can be set to block whenever there's a pd+ notification, only if the dmg dealt differs from the ingame msg or never by using l4d_pdp_block_ingame_dmgtxt.
- Added tracking of stats totals, the data is currently collected but unused, future versions of the plugin will make use of it to display averages to users for comparison to their own stats.
- Reorganised, cleaned & commented code; added changes necessary for approval - including prefixing all cvars with l4d_.
- Fixed a minor error which caused stats deletion for any 'expirable' stats over New Years D=, apologies to anyone who lost stats, it was a small mistake in the coding and I didn't pick it up til a few days into this year but it is fixed now :>.
- Added cleanup function for the welcome register (the file that records who has already had their 'first visit welcome message') which runs whenever the stats cleanup function does, the number of days since last visit before removal from the welcome register can be set using l4d_pdp_welc_reg_timeout.
- Fixed timer handle failing to be reset which was causing some spam in the error logs.
- If updating it's worth deleting/moving pouncedamageplus.cfg from cfg/sourcemod and letting the plugin rebuild a fresh one using all the new cvar names now that they've all been changed from pdplus_ to l4d_pdp_ .

Version 0.9.0
- The top <n> menu is now sent page-by-page, 5 entries at a time, with a user-controlled delay set by saying !pdptopdelay <n> in chat, <n> is the required delay in seconds, leave blank to toggle thru defaults.

Version 0.8.9
- Damage is now applied properly to players' temporary health (pills, adrenaline + b+w) as well as their regular health.
- Fixed some hintbox notification items being repeated.
- Added register for the welcome msg so it will now only ever be sent to a player once (cleanup function to come but the file shouldn't get too large at less than a couple thousand players).

Version 0.8.8
- Bugfixes to the plugin's timer behaviour to keep all timers unique to each user, as well as some other minor fixes in the plugin's behaviour.
- Re-re-done notifications system to be less obtrusive, included a welcome message to avoid repeatedly explaining the impact of the plugin to users.
- Added victim + attacker only notifications option
- Added gamemode filter cvar to allow the plugin to automatically disable itself when in an undesired gamemode.
- Added the ability to set the minimum value at which pounce notifications kick in.
- Brand new stats system with (fairly) detailed user stats and a personal best's ranking system.

Version 0.6.1

- Fixed carry-over damage being reapplied to same survivor on every subsequent non-carry-over pounce on the server.
- Further improvements to notification system.
- Added the ability to scale the incap carry-over damage using pdplus_incap_scale.
- Added the ability to toggle incap carry-over damage notifications with pdplus_incapnotify.

Version 0.5.2
- Fixed the earlier update breaking the plugin for L4D2 >,<, the plugin remains compatible with both L4D1 & L4D2
- Slightly improved the accuracy of the damage calculation
- Completely redone notification system with chat and hintbox notifications (see pdplus_notify cvar for more info).

Version 0.4.5
- Added L4D1 support.

Version 0.4.0
- First version.
Attached Files
File Type: sp Get Plugin or Get Source (pouncedamageplus.sp - 4185 views - 79.1 KB)

Last edited by extrospect; 01-26-2010 at 02:29.
extrospect is offline