Help: Making only *one* player hear something.
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
Help: Making only *one* player hear something.
Hey people,
I'm trying to convert AGR CustomTF to use FTE as a server and am trying to replace the (non compatible) 'clientsound' function with a new version which uses .dimension_see and .dimension_seen
OBJECTIVE: To make it so that a gassed / hallucinating player hears music, but no-one else does.
The function is called like this:
The new (FTE compatible) function is (credit Spike):
The hallucinating player does hear the music. BUT for some reason however, NON-hallucinating players can *also* hear the music. Interestingly enough, the music they hears does not originate from the hallucinating player. It *seems* to come from a fixed position - the spot where the hallucinating player first hallucinated..
I previously tried:
e.dimension_see = e.dimension_seen = 1042;
but the effect was the same.
Anyway, I'm completely stuck, there's no documentation, and I'm too newb to understand FTEQW source code, or even guess as to how to make this work.
any response appreciated,
OneManClan
ps Reminder, I'm still a newb so please feel free to dumb down explanations as much as possible.
pps Is there any examples of the .dimension stuff someone has coded I can see?
I'm trying to convert AGR CustomTF to use FTE as a server and am trying to replace the (non compatible) 'clientsound' function with a new version which uses .dimension_see and .dimension_seen
OBJECTIVE: To make it so that a gassed / hallucinating player hears music, but no-one else does.
The function is called like this:
- Code: Select all
// te is the hallucinating player
clientsoundb(te,#CHAN_MISC,"ambience/acidtrip.wav",1.0,#ATTN_NORM);
The new (FTE compatible) function is (credit Spike):
- Code: Select all
void(entity e, float chan, string samp, float vol, float atten) clientsoundb =
{
e.dimension_see = 1024;
e.dimension_seen = 2048; /*make us the only receiver, no other player should have this bit set*/
sound(e, chan, samp, vol, atten);
e.dimension_see = e.dimension_seen = 255; /*back to default*/
};
The hallucinating player does hear the music. BUT for some reason however, NON-hallucinating players can *also* hear the music. Interestingly enough, the music they hears does not originate from the hallucinating player. It *seems* to come from a fixed position - the spot where the hallucinating player first hallucinated..
I previously tried:
e.dimension_see = e.dimension_seen = 1042;
but the effect was the same.
Anyway, I'm completely stuck, there's no documentation, and I'm too newb to understand FTEQW source code, or even guess as to how to make this work.
any response appreciated,
OneManClan
ps Reminder, I'm still a newb so please feel free to dumb down explanations as much as possible.
pps Is there any examples of the .dimension stuff someone has coded I can see?
- OneManClan
- Posts: 243
- Joined: Sat Feb 28, 2009 2:38 pm
Unless otherwise stated by Spike regarding FTE, sounds in Quake aren't tied to entities but tied to original playback coordinates, so I'm afraid you won't be able to contour that easily. Maybe a non-attenuated loop music could be used to avoid it, but then you'll have another problem to resolve: how to stop it once the hallucination effect wear off. I don't know if either FTE or Darkplaces have some extension to deal better with this.
Another way to contour that would be to to send to the hallucinated client only a play cdtrack message (DP supports custom cdtracks in OGG or MP3 formats, dunno about FTE): you wouldn't need to worry about attenuation since it's a soundtrack, and you could easily stop the sound simply stopping the track. This has the additional bonus of not requiring any special extension from the server side (can be done in pure QuakeC).
Another way to contour that would be to to send to the hallucinated client only a play cdtrack message (DP supports custom cdtracks in OGG or MP3 formats, dunno about FTE): you wouldn't need to worry about attenuation since it's a soundtrack, and you could easily stop the sound simply stopping the track. This has the additional bonus of not requiring any special extension from the server side (can be done in pure QuakeC).
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Hey Frag.machine,
Not sure what you mean by 'original playback coordinates' or by 'contour'.
The effect was working perfectly using the 'clientsound' function (the old server provided) - ie the gassed player heard the music and noone else could. FTE came out years later, so I assume it can be done. Spike is confident that .dimension_ can do it, but there seems to be no documentation, and the only info on .dimension I've found is from Spike himself:
I'm assuming I've missed something, or my newbiness has left out some crucial bit of information.
Well the acidtrip.wav IS a loop, and it is/was stopped by playing a null wav on the same channel. I haven't got onto that part yet w this FTE version.
thanks for the response,
OneManClan
ps I've never used 'CDtracks' - does this mean the player has to actually have a cd in the 'cd drive', or can the server just send the client a mp3, and it gets stored on the HD along w the rest of the sounds?
frag.machine wrote:Unless otherwise stated by Spike regarding FTE, sounds in Quake aren't tied to entities but tied to original playback coordinates, so I'm afraid you won't be able to contour that easily.
Not sure what you mean by 'original playback coordinates' or by 'contour'.
The effect was working perfectly using the 'clientsound' function (the old server provided) - ie the gassed player heard the music and noone else could. FTE came out years later, so I assume it can be done. Spike is confident that .dimension_ can do it, but there seems to be no documentation, and the only info on .dimension I've found is from Spike himself:
self.dimension_see defines which 'dimensions' a player can see (including sounds). float dimension_send defines which dimensions the current effect is in. Its a bitfield (so you can have 23 dimensions)
I'm assuming I've missed something, or my newbiness has left out some crucial bit of information.
frag.machine wrote:Maybe a non-attenuated loop music could be used to avoid it, but then you'll have another problem to resolve: how to stop it once the hallucination effect wear off.
Well the acidtrip.wav IS a loop, and it is/was stopped by playing a null wav on the same channel. I haven't got onto that part yet w this FTE version.
thanks for the response,
OneManClan
ps I've never used 'CDtracks' - does this mean the player has to actually have a cd in the 'cd drive', or can the server just send the client a mp3, and it gets stored on the HD along w the rest of the sounds?
- OneManClan
- Posts: 243
- Joined: Sat Feb 28, 2009 2:38 pm
OneManClan wrote:frag.machine wrote:Unless otherwise stated by Spike regarding FTE, sounds in Quake aren't tied to entities but tied to original playback coordinates, so I'm afraid you won't be able to contour that easily.
Not sure what you mean by 'original playback coordinates' or by 'contour'.
Well, the "contour" part is my bad use of english (sorry
OneManClan wrote:The effect was working perfectly using the 'clientsound' function (the old server provided) - ie the gassed player heard the music and noone else could. FTE came out years later, so I assume it can be done.
clientsound is not a standard builtin, and thus may or may not be supported in FTE (or may behave differently).
OneManClan wrote:Spike is confident that .dimension_ can do it, but there seems to be no documentation, and the only info on .dimension I've found is from Spike himself:self.dimension_see defines which 'dimensions' a player can see (including sounds). float dimension_send defines which dimensions the current effect is in. Its a bitfield (so you can have 23 dimensions)
I'm assuming I've missed something, or my newbiness has left out some crucial bit of information.
Yup, you're assuming clientsound is part of "core" QuakeC. Isn't. You'll need to adapt your code to use FTE version.
OneManClan wrote:frag.machine wrote:Maybe a non-attenuated loop music could be used to avoid it, but then you'll have another problem to resolve: how to stop it once the hallucination effect wear off.
Well the acidtrip.wav IS a loop, and it is/was stopped by playing a null wav on the same channel. I haven't got onto that part yet w this FTE version.
This trick may not work in all engines; I used that in DP and FitzQuake with success, but I remember people relating problems with other engines. YMMV.
OneManClan wrote:ps I've never used 'CDtracks' - does this mean the player has to actually have a cd in the 'cd drive', or can the server just send the client a mp3, and it gets stored on the HD along w the rest of the sounds?
Not exactly. With DP, you can replace the phyisical CD disk with a "cdtracks" folder into your mod containing the fake tracks (in .ogg or .mp3 format IIRC), using the "track<0-9>" name notation. I believe FTE supports something similar, but Spike can help you better than me on that.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
You can send "play sound.wav" commands to single clients through stuffcmd, but it will always be attenuated. Sending the "cd loop #" command may work better.
-

mankrip - Posts: 915
- Joined: Fri Jul 04, 2008 3:02 am
- Code: Select all
if (self.impulse == 241)
{
self.dimension_see = 1024;
self.dimension_seen = 2048;
sound(self, 3, "weapons/r_exp3.wav", 1, 0);
self.dimension_see = self.dimension_seen = 255;
bprint("self mismatched (silent)\n");
}
if (self.impulse == 242)
{
self.dimension_see = 1024;
self.dimension_seen = 1024;
sound(self, 3, "weapons/r_exp3.wav", 1, 0);
self.dimension_see = self.dimension_seen = 255;
bprint("self matched (sound)\n");
}
if (self.impulse == 243)
{
other = spawn();
other.dimension_see = 1024;
other.dimension_seen = 2048;
sound(other, 3, "weapons/r_exp3.wav", 1, 0);
other.dimension_see = other.dimension_seen = 255;
bprint("other mismatched (silent)\n");
}
if (self.impulse == 244)
{
other = spawn();
other.dimension_see = 1024;
other.dimension_seen = 1024;
sound(other, 3, "weapons/r_exp3.wav", 1, 0);
other.dimension_see = other.dimension_seen = 255;
bprint("other matched (silent)\n");
}
if (self.impulse == 245)
{
other = spawn();
sound(other, 3, "weapons/r_exp3.wav", 1, 0);
bprint("other normal (sound)\n");
}
works as bprinted and intended
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
UPDATE:
The effect is now working on my home comp!!! (WinXP), BUT it DOESNT work on the actual server (linux) tastyspleen.net:26666.
Why? Possibilities:
1. There's a difference in the two versions of FTEQW server
2. Something in my .cfg is messing something up
3. Unknown newbie element
Btw, I *did* check to make sure both servers are using the same .dat, and they are, so i don't know wtf is going on; still, it's great to see the effect working *somewhere*!
the quest continues..
thanks,
OneManClan
ps Intriguing how the music the non-gassed player hears is fixed in the position where the gassed player originally got gassed. I wonder what's going on..
The effect is now working on my home comp!!! (WinXP), BUT it DOESNT work on the actual server (linux) tastyspleen.net:26666.
Why? Possibilities:
1. There's a difference in the two versions of FTEQW server
2. Something in my .cfg is messing something up
3. Unknown newbie element
Btw, I *did* check to make sure both servers are using the same .dat, and they are, so i don't know wtf is going on; still, it's great to see the effect working *somewhere*!
the quest continues..
thanks,
OneManClan
ps Intriguing how the music the non-gassed player hears is fixed in the position where the gassed player originally got gassed. I wonder what's going on..
- OneManClan
- Posts: 243
- Joined: Sat Feb 28, 2009 2:38 pm
OneManClan wrote:Possibilities:
1. There's a difference in the two versions of FTEQW server
YES indeed, upgrading to the latest version of the FTE server SOLVED the issue and the effect works(!) ... perfectly !!
BIG THANKS to Spike for making it happen, and his patience w my newbiness.
This solves the question of how to make one player 'hear' something no-one else can hear. The next item on my dream-coding list is already looking much more challenging: To make one player NOT hear anything - Deafness, but I'll save that for another thread.
thanks for the feedback,
OneManClan
- OneManClan
- Posts: 243
- Joined: Sat Feb 28, 2009 2:38 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest