Knockback Modifier #5
Replies: 1 comment 2 replies
-
Quick window regarding how it is achievedYou can achieve this in three different, but still similar ways ( as in, they utilize CTFPlayer::ApplyPushFromDamage ). 1 - The insane method. Change the value of flDamageForceReduction by getting its offset ( I should have it somewhere ) and then... you might say load to that address, but it's an immediate, or whatever it is, so you'd have to write some code to make it jump to your own code. But as Lord Scag has mentioned, you'd need lots of good scotch and a couple of nights, and some headache. 2 - The eTakeDamageInfo Info yoinker. Basically, you'd just need to store the damage value, scale it to your liking, load and call it a day. 3 - Last but not least, the "damage force increase hidden" attribute method. You just need to listen to pre and post of CTFPlayer::ApplyPushFromDamage. At the end of the day, all of these methods work and achieve the same result, but the third method is the easiest. |
Beta Was this translation helpful? Give feedback.
-
Knockback Modifier
This plugin lets you change the knockback of a weapon, as easy as that.
How to apply the attribute
Shove it inside tf_custom_attributes.txt if you want to replace a normal weapon's model ( or anything else that supports custom attributes ) or in the Custom Attributes section inside a custom weapon's cfg if you use Custom Weapons X.
"knockback modifier" "value"
value: 1.0 is the default knockback. 0.5 would be half of the original knockback and 1.5 would be 50% more knockback.
You can change it as much as you want, even remove it by putting 0.0.
Example:
0.4
( 60% less knockback )Dependencies
Dhooks
Custom Attributes Framework
TF2 Attributes
You might need this dependency as well if you want to compile it yourself.
If you find any issues let me know.
Beta Was this translation helpful? Give feedback.
All reactions