Thread: SM Damage
View Single Post
Vulkan
New Member
Join Date: May 2009
Old 05-03-2009 , 01:45   Re: SM Damage
Reply With Quote #93

Quote:
Originally Posted by MaximReapage View Post
Here's an interesting one for you...in Left4Dead, the plugin works, but only against human-playable characters IE bots and special infected minus the witch. Is there any way you can make it so that the damage mod will also be good against both the witch and the common infected?
I've modified the plug-in to work for the common infected mobs and the witch, as well as modified some of the workings to avoid some Left 4 Dead specific oddities: For example, when fighting the tank with the plug-in activated, and you did more damage to it from a single attack than what the tank had total, this line would be evoked:

SetEntityHealth(client,0);

However it would cause it to just sort of drop dead with no death animation, and the screen would continue shaking for some time after it died, I commented the line out which has the effect of disabling the extra damage whenever your damage is above what the victim's health is which fixes the problem but carries with it that you can't use extraordinarily high multipliers, otherwise it will have no effect on "player" type characters. (The common infected and witch don't apply to this, they'll take the extra walloping just fine if you decide for some reason you want to have a multiplier of 1,000)

The other change I've made is that it detects friendly fire, upon which the function ends and the teammate will only take regular damage, I suppose this could be made into a cvar option but I didn't really look into it.

These changes are very Left 4 Dead specific, so I suppose you can consider this version of the plug-in specific for Left 4 Dead use.

I'm nowhere near being a coder, and admittedly it's a pretty hacked up job so if someone with more experience can check it and see if it can be made to work better or more efficiently, it'd be much appreciated.
Attached Files
File Type: sp Get Plugin or Get Source (sm_damage_l4d.sp - 650 views - 8.0 KB)
File Type: smx sm_damage_l4d.smx (7.3 KB, 262 views)
Vulkan is offline