Raised This Month: $ Target: $400
 0% 

Quick damage type info (TF2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-04-2015 , 20:29   Re: Quick damage type info (TF2)
Reply With Quote #1

btw, don't use that example to force crits on or off... that's what TF2_CalcIsAttackCritical is for.

Now, talking about crits is a good time to mention SM 1.7's SDKHook_OnTakeDamageAlive.

Its damage argument is post-minicrit/post-crit/post-random spread, which makes it extremely useful if you want to find out if it would kill a player or not and block if it does.

It also has a corresponding SDKHook_OnTakeDamageAlivePost.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-04-2015 at 20:30.
Powerlord is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 02-04-2015 , 22:06   Re: Quick damage type info (TF2)
Reply With Quote #2

Quote:
Originally Posted by Powerlord View Post
btw, don't use that example to force crits on or off... that's what TF2_CalcIsAttackCritical is for.
Is the result not the same? What does TF2_CalcIsAttackCritical do differently?

Quote:
Originally Posted by Powerlord View Post
Now, talking about crits is a good time to mention SM 1.7's SDKHook_OnTakeDamageAlive.

Its damage argument is post-minicrit/post-crit/post-random spread, which makes it extremely useful if you want to find out if it would kill a player or not and block if it does.

It also has a corresponding SDKHook_OnTakeDamageAlivePost.
I look forward to that function and the many things that will be fixed.
CoolJosh3k is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-10-2015 , 10:44   Re: Quick damage type info (TF2)
Reply With Quote #3

Quote:
Originally Posted by CoolJosh3k View Post
Is the result not the same? What does TF2_CalcIsAttackCritical do differently?
For one, it's a dedicated way of managing crits.

For two, mixing the two methods will result in one of them not working as the other will override it.

Anyway, SM 1.7 has come out since this thread started. SM 1.7 has a new hook type in SDKHooks: SDKHook_OnTakeDamageAlive (and SDKHook_OnTakeDamageAlivePost).

While this is likely too late to change the damagetype from being a crit/mini-crit (crit/mini-crit damage calculations have already happened), it will give you the real damage the player is about to take / has taken. Of course, since this is a pre hook, you can adjust the damage taken here.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-10-2015 at 10:45.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode