AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon Animation Speed (https://forums.alliedmods.net/showthread.php?t=314322)

eat1k 02-13-2019 13:46

Weapon Animation Speed
 
Is there any way to change weapon animation speed? Specifically reload animation.

I tried setting m_flFrameRate/var_framerate in Ham_Weapon_SendWeaponAnim but it didn't work. The speed hasn't changed.

PHP Code:

// Thanks to Vaqtincha
new const g_iReloadAnims[any:WEAPON_P90 1] = {
    -
15, -13, -16, -111, -1144231113741361113, -1411, -11
};

public 
hamfwd_SendWeaponAnim_Pre(pWeaponiAnimiSkipLocaliBody)
{
    if(!
IsCustomWeapon(pWeapon))
        return 
HAM_IGNORED;

    new 
WeaponIdType:iId get_member(pWeaponm_iId);
    if(
iAnim == g_iReloadAnims[iId])
        
set_entvar(iAnimvar_framerate3.0); // 3x faster

    
return HAM_IGNORED;



PartialCloning 02-13-2019 16:46

Re: Weapon Animation Speed
 
1. set_entvar to pWeapon, not iAnim. It expects an entity.
2. Reload animations are not static, g_iReloadAdmins doesn't cover all cases like silent USP and M4A1.
3. I don't think it's possible without editing the model. Use sub models and pev_body. While v models and pev_body don't work well, you might be able to get away with it if you're only using it for reload animation and switch back to the default models once it's done.

eat1k 02-13-2019 17:42

Re: Weapon Animation Speed
 
Quote:

Originally Posted by PartialCloning (Post 2639516)
1. set_entvar to pWeapon, not iAnim. It expects an entity.
2. Reload animations are not static, g_iReloadAdmins doesn't cover all cases like silent USP and M4A1.
3. I don't think it's possible without editing the model. Use sub models and pev_body. While v models and pev_body don't work well, you might be able to get away with it if you're only using it for reload animation and switch back to the default models once it's done.

I also tried with pWeapon and it didn't work. I want to add a CVar to change the reload speed but to do it better I wanted to change the animation speed, too. Because of this I want to change it without changing the model. Some scripter said me it's possible so maybe someone else knows how to do it.

thEsp 02-17-2019 06:27

Re: Weapon Animation Speed
 
I found something ...

eat1k 02-17-2019 07:36

Re: Weapon Animation Speed
 
Quote:

Originally Posted by thEsp (Post 2639998)
Just search a bit more ...

At the moment there is no way to do it. I think it's possible only by changing frames but the animation will be abrupt. Moreover, some people said me it's impossible (to do it good without bugs) as minumum because the framerate it's hardcoded in the engine.

CrazY. 02-17-2019 07:37

Re: Weapon Animation Speed
 
Weapon viewmodel it's handled in client side. You can try with FM_AddToFullPack. If that doesn't work I don't think there's another method to do.


All times are GMT -4. The time now is 00:57.

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