Raised This Month: $32 Target: $400
 8% 

Solved TF2: Block falling "woosh" sound (fall_damage_indicator.wav)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugzy
Junior Member
Join Date: Nov 2013
Location: Perth, Australia
Old 10-27-2017 , 14:09   TF2: Block falling "woosh" sound (fall_damage_indicator.wav)
Reply With Quote #1

The Team Fortress 2 Jungle Inferno Update added a new "whooshing" sound that indicates when you're about to take fall damage. Unfortunately, this is not very appropriate for Surf because you constantly keep hearing this sound. I've tried to block it by hooking normal sounds like so:

Code:
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
	AddNormalSoundHook(SoundHook_Whoosh);
}

public Action SoundHook_Whoosh(int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH],
	int &entity, int &channel, float &volume, int &level, int &pitch, int &flags,
	char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
	if (strcmp(sample, "player/fall_damage_indicator.wav") == 0)
	{
		PrintToServer("Blocking %s", sample);
		return Plugin_Stop;
	}

	return Plugin_Continue;
}
Unfortunately, this approach doesn't work. When I tested the code, I found that SDK Tools isn't even detecting the sound at all. That is, the string called "sample" will never contain "player/fall_damage_indicator.wav". Is there anything I can possibly do?

Last edited by Bugzy; 11-01-2017 at 14:18.
Bugzy is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 10-27-2017 , 14:31   Re: TF2: Block falling "woosh" sound (fall_damage_indicator.wav)
Reply With Quote #2

the sound could be something like ")player/" or whatever

https://developer.valvesoftware.com/...und_Characters
__________________
Chdata is offline
Bugzy
Junior Member
Join Date: Nov 2013
Location: Perth, Australia
Old 10-27-2017 , 15:10   Re: TF2: Block falling "woosh" sound (fall_damage_indicator.wav)
Reply With Quote #3

Quote:
Originally Posted by Chdata View Post
the sound could be something like ")player/" or whatever

https://developer.valvesoftware.com/...und_Characters
You seem to be correct about the special sound characters. On line 2864 of the diff page, I listed above it reads:

Quote:
"wave" ")player/fall_damage_indicator.wav"
Unfortunately, I don't know what to do with this information. Sorry for not being more clear but when I say sample will never be equal to "player/fall_damage_indicator.wav", I mean I had the function explicitly print out each and every single instance of sample to the chat. Furthermore, borrowing from Powerlord, we can use StrContains instead of strcmp like so:

Code:
public Action SoundHook_Whoosh(int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH],
	int &entity, int &channel, float &volume, int &level, int &pitch, int &flags,
	char soundEntry[PLATFORM_MAX_PATH], int &seed)
{

	PrintToChatAll("Sample: %s", sample);

	if (StrContains(sample, "fall_damage") > -1)
	{
		PrintToServer("Blocking %s", sample);
		return Plugin_Stop;
	}

	return Plugin_Continue;
}
In practice, chat will never see "Sample: player/fall_damage_indicator.wav", so the StrContains comparison doesn't even have a chance to work. I suspect that this might be because the sound is being played client-side rather than server-side. Is there anything I can do to stop this?

Last edited by Bugzy; 10-28-2017 at 02:43. Reason: spelling
Bugzy is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-27-2017 , 22:29   Re: TF2: Block falling "woosh" sound (fall_damage_indicator.wav)
Reply With Quote #4

Not all sounds are server-side. It may be that the client sees that it fell past a certain distance and plays the sound.

I'm not aware of a cvar to disable this, though.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-27-2017 at 22:30.
Powerlord is offline
Bugzy
Junior Member
Join Date: Nov 2013
Location: Perth, Australia
Old 11-01-2017 , 14:15   Re: TF2: Block falling "woosh" sound (fall_damage_indicator.wav)
Reply With Quote #5

One of the recent TF2 updates has since now fixed this problem.
Bugzy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:56.


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