I've kept working at this off and on in my little mod, mainly in tailoring it specifically for that, but this week-end I started into an accents add on for it. Using the FindSubString routine I only found out the varied uses for recently (for the
Hex String to Int converter), and a simple letter/letter grouping replacement system.
So far I've just been playing around with simple accents (replace "simple" with cliched there, really) for it, and accents that I've used for characters I've played/DM'd.
Here's a few examples of the variety achieved so far, pulled directly from the logs. NPC name has been replaced with accent name. I'm not happy with the prevalence of "offed" instead of "killed", it's supposed to be the lowest level of reply, for below average to average (10) intelligence, but is the most common.
The only thing actually stored here as a string is the name of the creature killed, zombies of various sorts in these cases, since they're the most prevalent enemy in my mod.
// The only thing scarier than a bear in the woods? A Zombie bear in the woods.
[French/HM] You're Zherese Davis, right? You offed a monstrous zombie grizzly?
[French/HM] Aren't you zhe one zhat offed one of zhose large zombie brown bears?
// The same orc rumour in two different accents.
[French/HM]Is it true you offed one of zhose brutish zombie orcs?
[French/HM] Aren't you zhe one zhat offed zhat brutish zombie orc?
[Simple] Hey, Therese Davis. I heard'ja killed that brutish zombie orc.
// Same dwarven accent, same rumour, different random part components.
[Dwarf] Hey, Derese Davis. I heard you offed dat huge zombie bulette.
[Dwarf] You're de one dat killed dat huge zombie bulette?
[Dwarf] Is it true you offed one of dose huge zombie bulettes?
[Dwarf] I keep hearing how you offed a huge zombie bulette.
[Dwarf] Aren't you de one dat killed dat unholy stone giant?
Any ideas for accents that could be pulled off under this system?
To give an idea how it works, here's the "French" accent routine.
//// If bioware can use french accents in the expansions, I don't see why I shouldn't slap in
//// a cheesy french accent.
//// For Ravenloft - High Mordentish
string FB_AccentFrench (string sString)
{
string sFind, sReplace;
int nLength, nReplaceStart, nCaseSensative, nCount;
while (sFind != "DONE")
{
switch (nCount ++)
{
case 0: sFind = "me"; sReplace = "oi";
nLength = 2; nReplaceStart = 1; nCaseSensative = FALSE; break;
case 1: sFind = "Yes"; sReplace = "Oui";
nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
case 2: sFind = "yes"; sReplace = "oui";
nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
case 3: sFind = "No"; sReplace = "on";
nLength = 2; nReplaceStart = 1; nCaseSensative = FALSE; break;
case 4: sFind = "Th"; sReplace = "Zh";
nLength = 2; nReplaceStart = 0; nCaseSensative = TRUE; break;
case 5: sFind = " th"; sReplace = " zh";
nLength = 3; nReplaceStart = 0; nCaseSensative = TRUE; break;
case 6: sFind = "H"; sReplace = "'";
nLength = 1; nReplaceStart = 0; nCaseSensative = TRUE; break;
case 7: sFind = " h"; sReplace = "'";
nLength = 2; nReplaceStart = 1; nCaseSensative = TRUE; break;
case 8: sFind = "th"; sReplace = "'";
nLength = 2; nReplaceStart = 1; nCaseSensative = TRUE; break;
case 9: sFind = "I "; sReplace = "Ah";
nLength = 1; nReplaceStart = 0; nCaseSensative = TRUE; break;
default: sFind = "DONE"; break;
}
sString = FB_FindAndReplaceSubString (sString, sFind, nLength, sReplace, nReplaceStart, nCaseSensative);
}
return sString;
}
sFind is self explanatory, as is sReplace.
nLength is how many characters to skip when replacing. This is usually the length of sFind.
nReplaceStart is used if you're keeping certain characters from the original. Useful here to allow "No" and "no" to become "Non" and "non" off a single check, by leaving the original "n".
nCaseSensative is used largely when nReplaceStart > 0, for the use mentioned above.
Since I'm not sure how processor intensive FindSubString is, I'll be keeping all the accents under 20 replacements max, and preferably under 10, but other than that I'll put in any that people can suggest.
All I would need is an accent "name" to give it, and what to change. Adding one only takes about five minutes, so it's easy on my end to put more in before I package it up again into an erf.
Modifié par Failed.Bard, 10 juin 2012 - 03:21 .