garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

Scripted sequences do not raise GM:EntityEmitSound

Open Kogitsune opened this issue 11 years ago • 1 comments

Sounds emitted during scripted sequences don't raise EntityEmitSound.

hook.Add( "EntityEmitSound", "1", function( data ) print( data.SoundName ) end )

You can run this shared - only sounds emitted on the client raise EntityEmitSound, but that makes sense. Play on a map that uses them - d1_trainstation_xx have sequences near the spawns.

Kogitsune avatar Apr 20 '14 22:04 Kogitsune

Seems to be working in singleplayer, unable to get it to function in multiplayer.

Kogitsune avatar Apr 20 '14 22:04 Kogitsune

Any updates?

NathanX-S avatar Dec 20 '22 09:12 NathanX-S

Cannot reproduce this. Besides sounds from from sentences.txt (https://github.com/Facepunch/garrysmod-requests/issues/2005) all other sounds are correctly captured by the hook.

I used this code and ran around all the HL2 intro maps in multiplayer:

hook.Add( "EntityEmitSound", "TimeWarpSounds", function( t )
	
	t.Pitch = t.Pitch * 2.5
	if ( string.find( t.SoundName, "loop" ) ) then return true end
	if ( string.find( t.SoundName, "null.wav" ) ) then return true end
	
	print( t.SoundName, t.OriginalSoundName )
	return true
	
end )

robotboy655 avatar Oct 03 '23 17:10 robotboy655

I am going to assume this was about https://github.com/Facepunch/garrysmod-requests/issues/2005 or was fixed since.

robotboy655 avatar Oct 04 '23 12:10 robotboy655