Raised This Month: $51 Target: $400
 12% 

[TF2] Forcibly Speeding Up Weapon Switch Speed On-the-fly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alfonso Crawford
Member
Join Date: Feb 2012
Old 01-13-2020 , 18:00   [TF2] Forcibly Speeding Up Weapon Switch Speed On-the-fly
Reply With Quote #1

The Degreaser seems to have a limiter beyond attributes #199 and #547 affecting holster- and deploy-times. If I switch to the Degreaser, and then away from it too quickly, the attribute seems to be ignored: there appears to be a minimum required amount of time with the weapon out before speed boost is put into effect.

I've been experimenting with some code from 2011 to manually set m_flTimeWeaponIdle and m_flNextAttack, with no luck. Am I looking in the wrong place to do what I want?

PHP Code:
float current_time GetGameTime();
float idle_time GetEntPropFloat(weaponProp_Send"m_flTimeWeaponIdle");
float next_atk GetEntPropFloat(clientProp_Send"m_flNextAttack");

SetEntPropFloat(
    
weapon,
    
Prop_Send,
    
"m_flTimeWeaponIdle",
    
current_time + (idle_time current_time) * 0.2 // I've set both attributes to 0.2 on Degreaser
);
SetEntPropFloat(
    
client,
    
Prop_Send,
    
"m_flNextAttack",
    
current_time + (next_atk current_time) * 0.2
); 
I have the above code inside of a function hooked to SDKHook_WeaponSwitch. Am I setting the properties incorrectly? Is it even possible to speed up weapon switching through brute force like this? The speed of the animation itself (which gets truncated by this method, I'm told) doesn't matter to me at this phase: I just want to get the core functionality in-place.

Any guidance on how to proceed with what I'm trying to do is greatly appreciated. I'm still very inexperienced with entity properties. Thank you for your time.
Alfonso Crawford 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 02:30.


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