Different sounds for BE/DS caps?

I made a blank sound file, I just thought there may be a way to override it. Still I'm not able to get the assigned cap sounds to work. As I mentioned above, it's triggering the return sound.

.... and I just looked and saw this while rolling the marbles around in my hollow head...

Code:
}

function Flag::CapSounds( %team, %cl ) {

	return ( %team == Client::GetTeam( getManagerId() ) ) ? ( localSound( $Flag::ReturnSound[friendlyflag] ) ) : ( localSound( $Flag::ReturnSound[enemyflag] ) );
}

You may want to edit to reflect capsound rather than return sound to avoid future confusion.
 
good catch

copy/paste ftw

I honestly haven't tested it fully but it should work. WE'LL BE OUT OF BETA BY 2018.

edit: flagcapture.ogg flagreturn.ogg and flag1.ogg are sounds played via messages sent from the server (in objectives.cs) so that's why we have to delete them or rename them. if they still play you have that sound (with that name) somewhere else in ur base folder
 
Last edited:
question for lems:

The default flag sounds won't get overridden by another local sound that's played but in this script they will, which has caused me to be late in noticing a flag being capped. Is there a way to make it so that can't happen?

Not sure if the "profile" has anything to do with it in base\scripts\sound\nsound


SoundData SoundFlagCaptured
{
wavFileName = "flagcapture.wav";
profile = Profile3dMedium;
};

SoundData SoundFlagReturned
{
wavFileName = "flagreturn.wav";
profile = Profile3dMedium;
};

SoundData SoundFlagPickup
{
wavFileName = "flag1.wav";
profile = Profile3dMedium;
};

SoundData SoundFlagFlap
{
wavFileName = "flagflap.wav";
profile = Profile3dNear;
};
 
Last edited:
client-side local sound on caps is not ideal

when ur going fast the sound fades too

I could make an onlocalsound script that mutes anything but cap sounds for a delay_time but still...

it's funny how I look at this every 4 or 5 years and reach same conclusion insanity lol etc.

best would be server code ($zadmin::soundclient = 1; or something) that addresses friend vs. foe caps
 
There's got to be code somewhere that allows the default cap sound to not be overridden. It's not a big deal, I just commented out the cap sound lines for now. I appreciate you looking into it though.
 
There's got to be code somewhere that allows the default cap sound to not be overridden. It's not a big deal, I just commented out the cap sound lines for now. I appreciate you looking into it though.

The default cap sound is in a server message sent via chat and those always override local sounds. Local sounds are "local" in that they stay where they're played. When you move away from that location the sound diminishes. One fix would be to send a chat message to yourself with the proper sound. Another would be to hijack the command function and deliver the sound from there. I'd have to store the current waypoint and re-init it after the sound gets played. I'm not saying it's dead in the water but I'm going to sit on it for a bit and attempt to come up with an elegant solution. Bottom line is local sounds are not ideal for this.

Code:
Client::sendMessage(%playerClient, 0, "You captured the " @ getTeamName(%enemyTeam) @ " flag!~wflagcapture.wav");
 
Back
Top