Thanks for all the responses guys, much appreciated!
Frag.Machine, IIUC your code deals with audio only, and as Spike said, I'm using dimension_see flags to control audio. Having said that I am still studying your code, and will experiment with it at some stage, just out of curiosity.
Spike wrote:I have to ask though, is the aim to make the player unable to hear anything (including the someone-just-said-something-beep), or will you want to still be able to hear a select sounds (alternatives, announcements, etc)?
There will be alternative sounds. These include:
1. An Underwater version of the explosion (I made a second set of wavs which are played when a player is underwater, as discussed
here)
2. Whilst deafened/concussed (this thread), the player will only hear his own panicky breathing and maybe an additional 'weird sound'
3. Whilst hallucinating, the player hears music (and other groovy stuff), as discussed
here.
The basic solution here seems to be to replace the WRITEBYTE call with something else that does the same job. Spike suggests
herethat
Potential Solution A
Spike wrote:If you use DP or FTE, you should never need to do writebytes. There is a proper builtin to do it for you, somewhere. At least that's the theory. No new standard extensions expect you to use writebyte.
I'm assuming the reason Spike hasn't suggested this in the current prob is because multiple clients are being used, though I'm wondering if it could be a matter of sending multiple client-specific messages to different clients.. ie telling them to do their equivalent of a non-WRITEBYTE explosion.
Spike wrote:SVC_TEMPENTITY: Create a temporary special effect...
TE_EXPLOSION: specifically, create a dynamic light that will fade over time, a particle effect that looks somewhat like an explosion, an explosion sprite (in quakeworld anyway)... and yes... an explosion sound effect.
You then have the 3 axis coord of the explosion effect.
Sorry, but there's nothing in the client that allows you to have the particle effect without the sound.
Potential Solution B
Send the writebyte to everyone, but change the coordinates for the deaf player so the explosion happens somewhere far far away.
Potential Solution C
LeiLeilol's suggestion to substitute the TE_EXPLOSION with a new explosion effect, where a new, entity does it's visual effects at the 'impact point' and which can be silenced if needed. I understand there's some issue w some clients not having a 'particle' effect, BUT ... deaf/hallucinating/underwater players don't need to see explosions/particle effects anyway...
Potential Solution D
a modification of the
"SkinBlind" (Hallicinating player sees a different set of skins to everyone else) effect. Something like:
[EDIT: The following has been fixed by Spike (thanks!) and should actually work
]
Code: Select all
void (entity e) Explosion =
{
local entity e;
local float n;
msg_entity = e;
while (n < 32)
{
e = nextent(e);
if (e.classname == "") //only if the player is actually valid
continue;
if (e.is_deaf)
continue; // skip deaf players
WriteByte (#MSG_ONE, #SVC_TEMPENTITY);
WriteByte (#MSG_ONE, #TE_EXPLOSION);
WriteCoord (#MSG_ONE, thing.origin_x);
WriteCoord (#MSG_ONE, thing.origin_y);
WriteCoord (#MSG_ONE, thing.origin_z);
n = n+1;
}
};
[EDIT: Ugh, I think the above wont work[EDIT: Yes it will!], because the nature of WRITEBYTES is that
everyone hears them..[EDIT: not if they're sent to MSG_ONE!] OR ... will the above code will make an explosion 31 times for everyone else except the deaf player, who didn't get the message? [EDIT: No, because they're sent to MSG_ONE]Hm..]
Finally:
Potential Solution E
If your mod is in its own game dir, does that mean that the server doesn't search in other game dirs for files? Eg:
Quake/fortress/sound/foo.wav
Quake/NewMod/other_stuff
If we're playing 'NewMod', can NewMod clients access foo.wav?