Module:NameGenerator: Difference between revisions

m
fixed a bug that was duplicating wordbits i think
(removed trailing spaces and added real hyphenation)
m (fixed a bug that was duplicating wordbits i think)
Line 27: Line 27:
local hyphenationchance = naming[style]['HyphenationChance'] or 0
local hyphenationchance = naming[style]['HyphenationChance'] or 0
local twonamechance = naming[style]['TwoNameChance'] or 0
local twonamechance = naming[style]['TwoNameChance'] or 0
minprefix=naming[style]['MinPrefixAmount']
maxprefix=naming[style]['MaxPrefixAmount']
local namecount
local namecount
if math.random(0, 100) < twonamechance then
if math.random(0, 100) < twonamechance then
Line 35: Line 37:
local heroname = ''
local heroname = ''
for i = 1,namecount do
for i = 1,namecount do
prefixes = ''
infixes = ''
postfixes = ''
  --[get min/maxprefix stuff]--
  --[get min/maxprefix stuff]--
minprefix=naming[style]['MinPrefixAmount']
maxprefix=naming[style]['MaxPrefixAmount']
  for i=1,math.random(minprefix,maxprefix) do
  for i=1,math.random(minprefix,maxprefix) do
   prefixes = prefixes.. prefixtable[math.random(table.getn(prefixtable))]
   prefixes = prefixes.. prefixtable[math.random(table.getn(prefixtable))]