Author Topic: Sounds bug (player sounds not playing)  (Read 1951 times)

Offline Slayer :D

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
  • Rated:
Sounds bug (player sounds not playing)
« on: August 30, 2010, 10:59:27 AM »
How do I make a player whose sounds I do not have (e.g. he is using a skin called "asdasd/sfdsdf") make typical male sounds? When you shoot people, the sound generated is linked to players/<model_name>/pain#_#.wav. However, if you do not have the model (as in the above example of "asdasd"), you cannot hear the sounds. How do I force any non-male or female players to use the default player sounds.

edit: I checked more and it only occurs if you do not have the player model; if he uses male/qwerty you still hear the sounds. Also, I tested with s_show "1" and it shows that the players/<any_unknown_model>/<any_sound>.wav does not play; including falling sounds.
« Last Edit: August 31, 2010, 05:54:15 AM by Slayer :D »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline ReCycled

  • Carpal Tunnel Member
  • ******
  • Posts: 1690
    • View Profile
  • Rated:
Re: Sounds bug (player sounds not playing)
« Reply #1 on: August 30, 2010, 06:58:43 PM »
By default it should go to the set of male/grunt sounds. You don't have to do anything. I've never seen this issue with sound in Q2. Do other sounds play (wav, mp3 etc)?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
“It is hard to make predictions, especially about the future.” – Yogi Berra

Offline Slayer :D

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
  • Rated:
Re: Sounds bug (player sounds not playing)
« Reply #2 on: August 31, 2010, 05:53:08 AM »
I found out what it is: a bug with the R1Q2 OpenAL sound loading code (default sound code works fine).

In S_OpenAL_LoadSound(sfx_t *sfx), there is the following code to load the sound:
Quote
// Load it from disk
if (sfx->name[0] == '#')
   Com_sprintf(name, sizeof(name), "%s", &sfx->name[1]);
else
   Com_sprintf(name, sizeof(name), "sound/%s", sfx->name);

if (!S_OpenAL_LoadWAV(name, &data, &info))
{
   Com_DPrintf ("WARNING: couldn't find sound '%s'\n", name);
   return false;
   //S_CreateDefaultSound(&data, &info);
}

This will only load players/model_name/xxxx.wav.
I tested this by replacing the "return false" with the following:
Code: [Select]
// Declarations at beginning of methodfor new local variables
char *slash1;
char *slash2;
char temp2[MAX_QPATH];



// begin patch code...
if(sfx->name[0] == '#')
{
// gets the slashes, and does some bug checking
slash1 = strchr(name, '/');
if(!slash1)
{
Com_Printf("WARNING: Could not find 1st '/'! Sound name: %s\n", LOG_CLIENT, name);
return false;
}
else if(name[(int)(slash1-name)+1] == 0)
{
Com_Printf("WARNING: Zero byte encountered after 1st '/'! Sound name: %s\n", LOG_CLIENT, name);
return false;
}
slash2 = strchr(slash1+1, '/');
if(!slash2)
{
Com_Printf("WARNING: Could not find 2nd '/'! Sound name: %s\n", LOG_CLIENT, name);
return false;
}
else if(name[(int)(slash2-name)+1] == 0)
{
Com_Printf("WARNING: Zero byte encountered after 2nd '/'! Sound name: %s\n", LOG_CLIENT, name);
return false;
}
// save the data
strcpy(temp2, slash2+1);
// expand to "players" directory...
Com_sprintf(name, sizeof(name), "players/male/%s", temp2);
// try loading that
if (!S_OpenAL_LoadWAV(name, &data, &info)) return false;
}
else return false;
// end patch

This, if it cannot find the players/model_name/xxx.wav looks for players/male/xxx.wav. I suppose I could do what default sound code does which is load from sound/player/male/xxx.wav by replacing the "players/male/%s" with "sound/player/male/%s", but I prefer to load from the players directory. I am also not certain if strchr will buffer overrun if you give it a pointer to the 0x00 string terminator byte, so it might be possible to remove the two checks for zero bytes.
« Last Edit: August 31, 2010, 05:55:08 AM by Slayer :D »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

 

Yotematoi

May 17, 2025, 08:33:15 AM
Yo desde el año 2007 me enfermé de Q2, es incurable  
Morir y revivir es costumbre, lástima q el QT estaba bueno
 

ImperiusDamian

May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
 

|iR|Focalor

May 11, 2025, 02:33:39 PM
 

-Unh0ly-

May 03, 2025, 08:02:46 AM
198.179.6.200:30634
 

Yotematoi

May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery." :D
 

|iR|Focalor

April 02, 2025, 02:47:07 AM
 

Yotematoi

February 14, 2025, 12:41:48 PM
 :-*
 

|iR|Focalor

February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.

0rbisson

February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last

Show 50 latest
Welcome, Guest. Please login or register.
May 21, 2025, 05:29:55 AM

Login with username, password and session length