I was playing BtRL and got fed up with the text to speech really struggling with some of the words(like viper, adama, mk) and remembered that UT2004 has a list of conversions in a config file which corrects things like that.
I dont know any c or c++ but have done a fair amount of java and while it would probably be a 5 min job for anyone else I thought I should probably have a go at implementing this myself as you no doubt have more important things to be working on.
The current implementation uses a compiled in array of strings as I couldnt find a good way to load it from a file.
The code belongs in the speech.cpp file in the speech_play function just after the length of the input text is checked against the maximum length.
//start nasty code
//do the conversion
//nead to load this from a file really
const NUMWORDS=8;
char *wordOriginal[NUMWORDS] = {"adama","mk", "ii", "vii", "ix","dradis","viper","tyllium"};
char *wordReplace[NUMWORDS] = {"aadamma","mark", "2", "7", "9","draydiss","vi'per","t'illi-um"};
char textCopy[MAX_SPEECH_CHAR_LEN];
//work on a copy of the text as it might not be safe to modify the original
memcpy(textCopy,text,len + 1);
//force to lower case to make matching easier (might be a bad idea)
strlwr(textCopy);
for (int j = 0; j < NUMWORDS; j++){
replace_all(textCopy,wordOriginal[j],wordReplace[j],MAX_SPEECH_CHAR_LEN,len);
}
//shouldnt be bigger than max as replace_all uses the limit
len = strlen(textCopy);
//end nasty code
This was tested using the 3.6.9 code from the CVS repository with BtRL (not FS2 etc).
I checked the latest version and couldnt see anything like it.
If anyone could finish it off so that it loads from a file that would be great.
I fully expect that there are major problems with the way ive implemented it but at least i didnt just say "dude dude dude dude dude dude implement this dude dude dude dude is it done yet. dude?"

Steve