Hi,
Some weapons animations can't and won't animate properly because there's not enough time given to them to play it or some of them are straight broken. I'll be listing these weapons with their fixes.
Side Note: These fixes won't effect gameplay in any way. These are just cosmetic fix. These fixes make game look more proper. Also HD models are compatiable with these fixes.
RPG: RPG's fidget animation can't animate properly because there's not enough time given to it.
To fix this:
Change:
iAnim = RPG_FIDGET;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0;
To:
iAnim = RPG_FIDGET;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0;
Gauss: Gauss's idle animation's are completely broken. This issue appears to be in Steam version. Retail version seems to be working properly.
To fix this:
Change:
{
int iAnim;
float flRand = RANDOM_FLOAT(0, 1);
if (flRand <= 0.5)
{
iAnim = GAUSS_IDLE;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
else if (flRand <= 0.75)
{
iAnim = GAUSS_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}
else
{
iAnim = GAUSS_FIDGET;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3;
}
return;
SendWeaponAnim( iAnim );
}
}
To:
if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
return;
if (m_fInAttack != 0)
{
StartFire();
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0;
}
if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
return;
int iAnim;
float flRand = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 0, 1);
if (flRand <= 0.75)
{
iAnim = GAUSS_IDLE;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 15.6 * (2);
}
else if (flRand <= 0.875)
{
iAnim = GAUSS_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 19.0;
}
else
{
iAnim = GAUSS_FIDGET;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 85.0 / 15.0;
}
SendWeaponAnim(iAnim);
}
Hand Grenade: Hand Grenade is supposed to play HANDGRENADE_DRAW animation after player threw a grenade.
Commenting out "m_flReleaseThrow = 0;" fixes our issue. Thanks to @SamVanHeer pointing this out.
```
//m_flReleaseThrow = 0;
m_flStartThrow = 0;
m_flNextPrimaryAttack = GetNextAttackDelay(0.5);
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5;
```
However after player ran out of grenades and pick up a grenade, it won't show up until player switch weapons.
We can easily fix this issue by removing " RetireWeapon(); "
if ( m_pPlayer->m_rgAmmo[ m_iPrimaryAmmoType ] )
{
SendWeaponAnim( HANDGRENADE_DRAW );
}
else
{
RetireWeapon(); //Delete this
return;
}
Satchel and Snark (Squeak):
Satchel can't animate it's draw animation properly. This issue happens in Snark as well.
in weapons.cpp:
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body )
{
if (!CanDeploy( ))
return FALSE;
m_pPlayer->TabulateAmmo();
m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel);
m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel);
strcpy( m_pPlayer->m_szAnimExtention, szAnimExt );
SendWeaponAnim( iAnim, skiplocal, body );
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; //Change 1.0 to 3.0
m_flLastFireTime = 0.0;
return TRUE;
}
This fixes draw animation problem. All i did was change, "m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;" to "m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0;"
This gives enough time to play draw animation to these weapons.
Be very careful when changing variables in weapons code, any change in timing could have unexpected side-effects.
@SamVanheer I can confirm these fixes are tested and doesn't break any weapons.
The crowbar never plays it's idle animations.
There's also the crowbar idle animations and the tripmines attaching animations (sequence names: arm1 and place)
@Don576 I'll look into that
@CS-PRO1 Those animations are beta animations, Valve dropped those animations during development.
More info : https://youtu.be/e59bvmvXPk0?t=202
They're still not cut tho. Maybe they were intended to be in the final one. Or maybe implement just "place" and drop "arm1"
@CS-PRO1 They're "leftover" from beta. These are common things in development. Devs became lazy or rush things and forgot delete those kinds of things. That's why they called "leftover".
I looked up idle animations of Crowbar and it seems Valve never implemented them. I don't really know if Valve dropped the idea during development or forgot adding them.
I looked up idle animations of Crowbar and it seems Valve never implemented them. I don't really know if Valve dropped the idea during development or forgot adding them.
I don't think so, in HL:S they work as intended.
Note that the Crowbar doesn't have a WeaponIdle method at all, and the Source SDK handles it by using a common base class that looks up animations by act, so that could just be an unintentional side-effect rather than intended behavior.
I've seen SC had fixed Idle for crowbar but I dunno if it's possible to implement in HL tho.
It's possible, but they didn't added. As the Sam said they not even added WeaponIdle and this made me think straight away they cut the crowbar animations.
Most helpful comment
@SamVanheer I can confirm these fixes are tested and doesn't break any weapons.