OK, finally at the point where I'm happy with this little script. You'll need perl for it.
I don't think this one can be turned into an executable too easily. I have most of the variable stuff hard-coded into it. Too lazy to try and give it any sort of control file or anything. But if someone wants to upgrade it to do that, they're welcome to.
You can download it at:
http://dffd.wimbli.com/file.php?id=463-----------------------------------------------------------------------------------
DFWordGenerator
by Mephansteras
This perl script is designed to make brand new languages for Dwarf Fortress. Useing it is fairly simple. However, it does require the Math::Random module. If you do not have it, you can get it using the PPM.
For those that need perl, I suggest going to
Active State and using their distribution. I also use the
Open Perl IDE which is a program that makes writing/editing/running perl scripts much easier. To use the PPM, after installing ActiveState it should be in the Perl/bin directory. You may want to add the following repository to it's list:
http://cpan.uwinnipeg.ca/PPMPackages/10xx/. I know that one has the Math::Random module on it.
All you need to do is update the file locations at the top of the program:
my $LangFile = 'C:\Games\DwarfFortress\40a\raw\objects\language_words.txt'; # This is the language file to get the words from
my $NewLanguage = 'DWARF_CHAOS'; ## This goes in the [trANSLATION: ] entry in the entities file
my $OutputFile = 'C:\Games\DwarfFortress\40a\raw\objects\language_' . $NewLanguage . '.txt'; # This is where the new language is going to go
The NewLanguage entry is the name of the language you're creating. It goes in the entities file under the race as [trANSLATION:YOUR_LANGUAGE] or whatever you've named it.
Next, you need to set the rules for the language.
First, you set the frequency of each vowel.
For example, if you want 'a' to be used often, set it to a high number like 10.
$Vow{'a'}{'Freq'} = 10;
Or, if you want it to be used infrequently, set it to a low number like 1 or 2
$Vow{'a'}{'Freq'} = 1;
If you don't want it to be used at all, set it to 0
$Vow{'a'}{'Freq'} = 0;
You can also give letters specific rules. They are:
$Vow{'a'}{'NoStart'} = 1 means the letter cannot start a word
$Vow{'a'}{'NoEnd'} = 1 means the letter cannot end a word
$Vow{'a'}{'NoDouble'} = 1 means that the letter cannot follow itself
$Vow{'a'}{'OnlyStart'} = 1 means that the letter can only start a word
$Vow{'a'}{'OnlyEnd'} = 1 means that the letter can only end a word
Setting any of them to 0 will turn off that rule
Do the same for the consonants, which is the next section in the program.
You are free to add in any letter combinations that you like. Simple add the appropriate line, and copy any rules you like from the existing letters.
Next you set the word specific rules. These will add more flavor to your language.
## StartWithCons = 1 means that the word can start with a consonant
## StartWithVowel = 1 means that the word can start with a vowel
## EndWithCons = 1 means that the word can end with a consonant
## EndWithVowel = 1 means the the word can end with a vowel
## NoDoubleCons = 1 means the word cannot have two consonant picks in a row
## NoDoubleVowels = 1 means the word cannot have two vowel picks in a row
my %Rules;
$Rules{'StartWithCons'} = 1;
$Rules{'StartWithVowel'} = 1;
$Rules{'EndWithCons'} = 1;
$Rules{'EndWithVowel'} = 1;
$Rules{'NoDoubleCons'} = 1;
$Rules{'NoDoubleVowels'} = 1;
Setting any of these to 0 will turn off that rule.
Have fun making languages, and if you have any issues you can PM on the dwarf fortress board, post in the thread about this program, or e-mail me at [my username] @ gmail.com