[library] namem 0.5

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Dreanh
Prole
Posts: 27
Joined: Fri Oct 10, 2014 2:36 am
Location: Norway

[library] namem 0.5

Post 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
Attachments
namem.rar
namem 0.4
(2.13 KiB) Downloaded 145 times
namem.love
0.4 - left click or r to generate
(3.38 KiB) Downloaded 144 times
Last edited by Dreanh on Mon Jun 29, 2015 7:42 pm, edited 14 times in total.
szensk
Party member
Posts: 155
Joined: Sat Jan 19, 2013 3:57 am

Re: [library] namem - another random name generator

Post 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)
Last edited by szensk on Fri Jun 12, 2015 4:27 pm, edited 1 time in total.
User avatar
Dreanh
Prole
Posts: 27
Joined: Fri Oct 10, 2014 2:36 am
Location: Norway

Re: [library] namem - another random name generator

Post by Dreanh »

Glad you like them. I think I've fixed it, still a lot of stuff I don't know about programming.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest