Nuclide
Software Development Kit for id Technology (BETA)
|
Sentences are the voice-acting backbone of the sound system. More...
Sentences are the voice-acting backbone of the sound system.
The sentences subsystem allows us to stitch sound samples together for the purpose of speech. Segments can have their volume pitch and other attributes altered as they're being played back within it. It's all defined using external text definitions.
Each line inside sound/sentences.txt
is a new sentence group.
The name of the group is the name you'll be referring to in entity work such as ambient_generic. You can even call a random group, as long as you enumerate a name, of which you can have up to 31:
You'll still only refer to the group FOOBAR
, but a random entry from your enumeration will be chosen.
If a sample is not in a sub-directory, it'll be assumed to be part of the 'vox' sub-directory, or the last valid path of the previous sample in a group. For example:
becomes:
When parameters are surrounded by spaces, this means they apply to all current samples. They can be overwritten later down the parsing.
When a parameter is attached to a sample, e.g.:
Then this parameter only applies to said segment. Whereas...
Will apply the pitch effect to all three succeeding segments.
Parameters:
(pXX) = Pitch. Valid values are from 50 to 150.
(vXX) = Volume. Valid values are from 0 to 100.
(sXX) = Start point in %. E.g. 10 skips the first 10% of the sample.
(eXX) = End point in %. E.g. 75 ends playback 75% into the sample.
(tXX) = Time shift/compression in %. 100 is unaltered speed, wheras 50 plays the sample back in half the time.
A lot of information was implemented with the help of: http://articles.thewavelength.net/230/
Functions | |
string | Sentences_GetSamples (string) |
Returns a string of sample for a given sentence. More... | |
int | Sentences_GetID (string) |
Returns the shared network ID for a given sentence. More... | |
string | Sentences_GetString (int id) |
Gets the sentences string for a given id. More... | |
void | Sentences_Shutdown (void) |
Called by CSQC_Shutdown() when the client game exits to clear the sentences buffer. More... | |
Macros | |
#define | SENTENCES_LIMIT 1536 |
Variables | |
string | g_sentences [1536] |
int | g_sentences_count |
int Sentences_GetID | ( | string | sentence | ) |
Returns the shared network ID for a given sentence.
string Sentences_GetSamples | ( | string | msg | ) |
Returns a string of sample for a given sentence.
string Sentences_GetString | ( | int | id | ) |
Gets the sentences string for a given id.
void Sentences_Shutdown | ( | void | ) |
Called by CSQC_Shutdown() when the client game exits to clear the sentences buffer.
#define SENTENCES_LIMIT 1536 |
string g_sentences[1536] |
int g_sentences_count |