Page 1 of 1

[library] namem 0.5

Posted: Fri Jun 12, 2015 3:36 pm
by Dreanh
Made a random name generator for one of my games, thought it gave pretty good names so I decided to make my first library. The generator can produce real names, words. It does repeat names, but it's rare.

How to:

Code: Select all

local namem = require "namem"

name = namem.makeName() --Will produce a name from 3 to 6 characters long
name = namem.makeName(5) --Will produce a name 5 characters long
name = namem.makeName(2,10) --Will produce a name from 2 to 10 characters long
namem.setRandomSeed(someSeed)
currentSeed = namem.getRandomSeed()
Examples:
Image

Changelog:
Update 0.4
- Added common letter combinations.
Update 0.3
- Improved the generator.
- Added some settings in init.lua.
Update 0.2
- Made the generator simpler and better.
- Now possible to set name length.
Update 0.11
- Localized namem table.
Initial release 0.1

Re: [library] namem - another random name generator

Posted: Fri Jun 12, 2015 3:50 pm
by szensk
I like the names generated by this method.

One oddity in the source. init.lua shouldn't make namem be a global variable, it should be local and returned via init.lua. This prevents polluting the global scope with variables. (And locals are faster than globals)

Re: [library] namem - another random name generator

Posted: Fri Jun 12, 2015 4:00 pm
by Dreanh
Glad you like them. I think I've fixed it, still a lot of stuff I don't know about programming.