Skip to content
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

[HD HL Models] Revolver has no reload sound #2351

Open
metita opened this issue Apr 29, 2019 · 4 comments
Open

[HD HL Models] Revolver has no reload sound #2351

metita opened this issue Apr 29, 2019 · 4 comments

Comments

@metita
Copy link

metita commented Apr 29, 2019

This is a well-known old bug, HD Revolver has no reload sound, this should be fixed modifying the .qc file and adding the correct event.

$sequence "reload" "reload" fps 37
---->
$sequence "reload" "reload" fps 37 { event 5004 70 "weapons/357_reload1.wav" }

Revolver fixed
Revolver source

@Step4enko
Copy link

Step4enko commented Apr 29, 2019

You can also add it without editing the .sq file.

Put in CPython class
float m_flSoundDelay;

CPython::Reload( void )
add:

        if (DefaultReload( 6, PYTHON_RELOAD, 2.0 ))
	{
		m_flSoundDelay = gpGlobals->time + 1.5; // Time after it sounds
	}
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + RANDOM_FLOAT ( 10, 15 );```

In CPython::WeaponIdle( void )
add:
if (m_flSoundDelay != 0 && m_flSoundDelay <= gpGlobals->time)
{
	EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_WEAPON, "weapons/357_reload1.wav", RANDOM_FLOAT(0.8, 0.9), ATTN_NORM);
	m_flSoundDelay = 0;
}

@SamVanheer
Copy link

That would cause multiple sounds to play if you're using a model that does have the sound.

@Step4enko
Copy link

Step4enko commented Apr 29, 2019

Of course it will. I just showed another way how to add it. And you should use ONLY ONE of them.

@SamVanheer
Copy link

Half-Life Asset Manager V1.1.0 supports adding events to models without having to decompile and recompile them: https://github.com/Solokiller/HL_Tools/releases/tag/HLAM-V1.1.0

Could be useful if the original source files are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants