Module:NameGenerator: Difference between revisions

Jump to navigation Jump to search
don't need cargo
(added some values for template variables that get filled in by c# in game rather than xml)
(don't need cargo)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
local p = {}
local p = {}
local cargo = mw.ext.cargo


function p.main(frame)
function p.main(frame)
local naming = require'Module:Sandbox/User:Illuminatiswag/namegen/NamingTable'
local namingtable = require'Module:NameGenerator/NamingTable'
local naming = namingtable.naming
local defaultvars = namingtable.defaultvars
local prefixes = ""
local prefixes = ""
local infixes = ""
local infixes = ""
Line 76: Line 77:
if templatetable ~= nil then
if templatetable ~= nil then
  local titletemplate = templatetable[math.random(table.getn(templatetable))]
  local titletemplate = templatetable[math.random(table.getn(templatetable))]
  local varstable = naming[style]['TemplateVars']
  local varstable = defaultvars
if naming[style]['TemplateVars'] ~= nil then
  for k,v in pairs(naming[style]['TemplateVars']) do
  varstable[k] = v
  end
end
  if varstable == nil then
  if varstable == nil then
   varstable = {}
   varstable = {}
  end
  end
  varstable['%*Name%*'] = { heroname }
  varstable['%*Name%*'] = { heroname }
varstable['%*Patron%*'] = { 'Agolgut', 'Bethsaida' }
  varstable['%*Rings%*'] = { 'Three-ringed', 'Four-ringed', 'Five-ringed', 'Seven-ringed', 'Eight-ringed', 'Nine-ringed', 'Twelve-ringed'}
  varstable['%*Rings%*'] = { 'Three-ringed', 'Four-ringed', 'Five-ringed', 'Seven-ringed', 'Eight-ringed', 'Nine-ringed', 'Twelve-ringed'}
  -- not gonna bother doing every number in the 1d10+2 range and don't know how to handle that automatically
  -- not gonna bother doing every number in the 1d10+2 range and don't know how to handle that automatically

Navigation menu