OK, a few comments: Contrary to what was previously said, Announcer sounds should be controlled by the server. This is to enforce that the sounds are played at appropriate times by the server. This is what all of Valve's games do.
Second, if you don't want other players to hear it, EmitSound's iEntIndex arg should be SOUND_FROM_LOCAL_PLAYER (defined in IEngineSound.h). Third, if you want sounds to be called from the map itself, you may want to make the GameRules entity have a PlayVO input that wraps the teamplay_broadcast_audio event: https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/client/clientmode_shared.cpp#L1093 Note that this takes a soundscript name and NOT a sound filename. team -1 (or 255) will send to everyone, 1 to spectators, 2 to team 1, and 3 to team 2. TF2 does this with 3 GameRules inputs on tf_gamerules: PlayVO, PlayVORed, and PlayVOBlue. They are often used to play announcer sounds when control points are captured, etc... On Thu, Aug 28, 2014 at 2:03 PM, Jan Hartung <jan.hart...@gmx.de> wrote: > I’ve changed the announcer to dispatch a message to the clients, but it’s > still the same issue: I seem to be able to hear other player’s sounds. > Maybe I’m using the wrong function to play the sound, as I just issue a > call to EmitSound(const char* soundname) from C_BaseEntity. > > > > Jan > > > > *Von:* hlcoders-boun...@list.valvesoftware.com [mailto: > hlcoders-boun...@list.valvesoftware.com] *Im Auftrag von *James Marchant > *Gesendet:* Dienstag, 19. August 2014 11:46 > *An:* Discussion of Half-Life Programming > *Betreff:* Re: [hlcoders] Sound issues > > > > Yes, you shouldn't really be trying to play client sounds on the server. > ------------------------------ > > Date: Tue, 19 Aug 2014 15:55:04 +0900 > From: omegal...@gmail.com > To: hlcoders@list.valvesoftware.com > Subject: Re: [hlcoders] Sound issues > > That's not really a good way to do an announcer. > > What you should do, is make a function on the client to play the > announcements, via a byte or something (index in an enum) > > and dispatch the message (ie: register a msgfunc) to players, and let them > play the sound locally on the client. > > > > You then also have the bonus ability to let clients override announcer > sounds, like making announcer replacements, as they don't need to be > precached to be played, plus, then you're not filling up the server with > sound events. > > > > > > > > On Mon, Aug 18, 2014 at 11:07 PM, Jan Hartung <jan.hart...@gmx.de> wrote: > > Hi list, > > > > Some weird things are going on with the sound in our SDK 2013 MP based > mod. First, there is a map with a looped sound in it, the entity is placed > in the center of the map and can be heard everywhere (it’s a small map and > the volume is high enough). Now, it sometimes happens that when I kill a > bot, this sound’s origin jumps to the place where I currently am. It may > jump to its original position when the next round starts or stays there for > a few rounds. At times, not related to any kill, the sound also duplicates, > so you can hear it twice while the two “copies” are out of sync. > > > > The second thing is that we got an announcer in the game, so there are > sounds which are played to every player. We loop through the players and > use UTIL_EmitSoundSuit in order to do so. The announcer received an > overhaul just recently, which also added multiple sounds for the same > event, which are set up as rndwave in the sound script. Since then I > notice, that whenever I stand close enough to another player, I can hear > the announcer’s line, which is played to the other player. However, > UTIL_EmitSoundSuit is supposed to play a sound audible to the player > itself, judging by the function’s comment. > > > > Has anyone seen these issues? > > > > Jan > > > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders > > > > > -- > -Tony > > > _______________________________________________ To unsubscribe, edit your > list preferences, or view the list archives, please visit: > https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders > > > -- Ross Bemrose
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders