Wavelength Logo
tl.jpg (2351 bytes) blank.gif (837 bytes) tr.jpg (2446 bytes)
blank.gif (837 bytes)
Radio Voices by Decker
blank.gif (837 bytes)
This tutorial modifies the client dll (in codedir\cl_dll)  to play audio sounds.

To use this feature, study the SENTENCES.TXT file which is in the PAK0.PAK(sounds\), and
use the sentence-names, prefixed with %! in a SAY or SAY_TEAM command like this:

say "%!HG_GREN0" - Will speak the human grunt's "Grenade!" voice
say_team "%!HG_ALERT3" - "Shit We got hostiles!" only to teammembers
say "Incoming, Take Cover! %!HG_COVER0" - Both text and voice

New sentences can be added to the SENTENCES.TXT file.
However, all clients must have the exact same SENTENCES.TXT file, otherwise it won't work!
 

1. Load up the client dll source code (remember, this is NOT the mp dll).

2. Open up cl_dll/saytext.cpp .

3. Find the function void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize )

6. Go to this line:

strncpy( g_szLineBuffer[i], pszBuf, max(iBufSize -1, MAX_CHARS_PER_LINE-1) );

And insert the following code:

    char szSentence[64], *szSetPtr=szSentence;
    strcpy(szSentence, "misc/talk.wav");

    char *szSentencePtr = strstr(g_szLineBuffer[i], "%!");
    if (szSentencePtr)
    {
        char *szEndPtr = szSentencePtr+1;

        // Copy !sentence
        while (*szEndPtr > ' ' && *szEndPtr < 'z')
        {
            *szSetPtr = *szEndPtr;
            szSetPtr++, szEndPtr++;
        }
        *szSetPtr='\0';

        // Remove the %!sentence string
        strcpy(szSentencePtr, szEndPtr);
    }
 

7. Find this line:

    PlaySound( "misc/talk.wav", 1 );

And comment it out, meaning it should look like this:

    //PlaySound( "misc/talk.wav", 1 );

Then on the next line add this:

    PlaySound(szSentence, 1);

8. Build the dll and check it out!

 

blank.gif (837 bytes)
bl.jpg (2471 bytes) blank.gif (837 bytes) br.jpg (2132 bytes)