-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Half-Life] Issues with weapon animations [Their Fixes Included] #2495
Comments
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 don't think so, in HL:S they work as intended. |
Note that the Crowbar doesn't have a |
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. |
I tested this in versions 1.0.1.6 and 1.0.0.5 (release build), and there didn't appear to be an idle animation for the Tau Cannon/Gauss. Perhaps this was an unused animation, like the one for the crowbar? EDIT: Also checked version 1.1.1.0 of the WON (Retail) version, also doesn't appear to be present there either. |
Judging from code Gauss's idle animations are intended because it has WeaponIdle. It doesn't work because of strings are missing. |
The Gauss's idle animations are disabled because there's a return statement before Lines 568 to 590 in c7240b9
It's been like that since SDK 1.0 so it's probably intentional. |
BUGBUGBUG - Only bug i could found with this fix is Shotgun continues to reload delayed when weapons switched during reload. This happens because Shotgun's reload depends on And the reason why it's happens because we've changed |
I did notice this as well. Hopefully someone finds a fix for this. |
My recommendation is to not change |
How would you do that? I'm new to this sorta stuff, so I wouldn't know. |
|
What would I put in the place of "stuff"? Would I be replacing *szViewModel, *szWeaponModel, etc. with specific weapon names? |
Using the satchel as an example: Lines 292 to 305 in c7240b9
Modify it to look like this: BOOL CSatchel::Deploy( )
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
//m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
BOOL result = FALSE;
if ( m_chargeReady )
result = DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" );
else
result = DefaultDeploy( "models/v_satchel.mdl", "models/p_satchel.mdl", SATCHEL_DRAW, "trip" );
if (result)
{
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3;
}
return result;
} Note how i've commented out the first assignment since the value is overwritten anyway. I've also replaced the return statement on the last line since that line was never reached before. Also keep in mind that some weapon functions are duplicated on the client side for prediction: halflife/cl_dll/hl/hl_weapons.cpp Lines 211 to 224 in c7240b9
If you modify the server side you also need to modify the client side so everything stays in sync. |
So then for the snark, it would change from this:
To this?
Am I getting this right? |
No. BOOL CSqueak::Deploy( )
{
// play hunt sound
float flRndSound = RANDOM_FLOAT ( 0 , 1 );
if ( flRndSound <= 0.5 )
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 100);
else
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 100);
m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
BOOL result = DefaultDeploy( "models/v_squeak.mdl", "models/p_squeak.mdl", SQUEAK_UP, "squeak" );
if (result)
{
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3;
}
return result;
} I'd suggest learning C++ before trying to figure stuff like this out, you really need to understand what's going on to fix stuff like this. |
I learn better by example. Thanks for the clarification though. |
A few notes:
Instead of commenting out Modify this: Lines 1182 to 1190 in c7240b9
To include this: void CBasePlayerWeapon::RetireWeapon()
{
// first, no viewmodel at all.
m_pPlayer->pev->viewmodel = iStringNull;
m_pPlayer->pev->weaponmodel = iStringNull;
//m_pPlayer->pev->viewmodelindex = NULL;
g_pGameRules->GetNextBestWeapon( m_pPlayer, this );
//If we're still equipped and we couldn't switch to another weapon, dequip this one
if (CanHolster() && m_pPlayer->m_pActiveItem == this)
{
m_pPlayer->SwitchWeapon(nullptr);
}
} And modify this: Lines 4648 to 4666 in c7240b9
To include this: BOOL CBasePlayer :: SwitchWeapon( CBasePlayerItem *pWeapon )
{
if (pWeapon && !pWeapon->CanDeploy() )
{
return FALSE;
}
ResetAutoaim( );
if (m_pActiveItem)
{
m_pActiveItem->Holster( );
}
m_pActiveItem = pWeapon;
if (pWeapon)
{
pWeapon->Deploy();
}
return TRUE;
} This allows switching to no weapon. When a weapon is retired, if the player still has it equipped after an attempted switch to next best weapon and the current weapon can be holstered the player's current weapon will be holstered. If you then pick up ammo for that weapon it will be deployed as usual. See also #3073 for a bug affecting Snark primary attack and #3069 for a bug that can cause the Snark's deploy animation to not play sometimes. |
@kisak-valve DONT FORGET DIS |
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:
To:
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:
To:
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.
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(); "
Satchel and Snark (Squeak):
Satchel can't animate it's draw animation properly. This issue happens in Snark as well.
in weapons.cpp:
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.
The text was updated successfully, but these errors were encountered: