Name generator

Post Reply
User avatar
Tharius
Site Admin
Posts: 21
Joined: Sun Sep 15, 2013 10:01 am

Name generator

Post by Tharius »

This is the name generator I've incorporated with my reroll. It's very easy to modify this and I've often thought of expanding it to generate names along race lines... see the name generators out there for elves or orcs for an idea of what I mean... it's also very easy to make male/female versions, all it in all it's simple and works well and can be expanded. If you do, please share.


sample use: #echo @newName()

// It is REQUIRED that keywords be enclosed in quote marks (eg: AND)

Code: Select all

#var namegen_male_start A|Ab|Ac|Ad|Af|Agr|Ast|As|Al|Adw|Adr|Ar|B|Br|C|C|C|Cr|Ch|Cad|D|Dr|Dw|Ed|Eth|Et|Er|El|Eow|F|Fa|Fr|G|Gr|Gw|Gw|Gal|Gl|H|Ha|Ib|J|Jer|K|Ka|Ked|L|Loth|Lar|Leg|M|Mir|N|Nyd|Ol|Oc|On|P|Pr|Q|R|Rh|S|Sev|T|Tr|Th|Th|Ul|Um|Un|V|Y|Yb|Z|W|W|Wic

Code: Select all

#var namegen_male_mid  a|ae|ae|au|ao|ar|are|ale|ali|ay|ardo|e|edri|ei|ea|ea|eri|era|ela|eli|enda|erra|i|ia|ie|ire|ira|ila|ili|ira|igo|o|oha|oma|oa|oi|oe|ore|u|y

Code: Select all

#var namegen_male_end a|"and"|b|bwyn|baen|bard|c|ch|can|d|dan|don|der|dric|dus|f|g|gord|gan|han|har|ius|jar|jan|k|kin|kith|kath|koth|kor|kon|l|li|lin|lith|lath|loth|ld|ldan|m|mas|mos|mar|mond|n|nydd|nidd|nnon|nwan|nyth|nad|nn|nnor|nd|p|r|red|ric|rid|rin|ron|rd|s|sh|seth|sean|t|th|th|tha|tlan|trem|tram|v|vudd|w|wan|win|win|wyn|wyn|wyr|wyr|wyth

Code: Select all

#function newName {
   // make tempname initially longer than maxlength
   #var tempname "12345678901234567890"
   #var counter 0

   // this controls the maximum length of the output name
   #if ( !(%defined(maxlength)) ) {
      #var maxlength 6
   }

   // tries 100 times to generate a name with sufficiently few characters.
   #while ( (%len(@tempname) > @maxlength) AND (@counter < 100 ) ) { 
      tempname=%concat(
              %item(namegen_male_start,%random(1,%numitems(namegen_male_start))),
              %item(namegen_male_mid,  %random(1,%numitems(namegen_male_mid))),
              %item(namegen_male_end,  %random(1,%numitems(namegen_male_end))));
      counter = @counter+1;
   }
   @tempname
}
Post Reply