Author Topic: Sounds bug (player sounds not playing)  (Read 1842 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:

 

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 14, 2024, 11:42:06 PM

Login with username, password and session length