This Minetest mod is intended as a helper to other mods that need to generate random names for NPCs and other mobs. I originally wanted to add proper names to the AliveAI mod, and it seemed sensible to just make it generic so other mods could use it too.
It also adds a 'stamper' tool that can be used to 'stamp' random names onto signs that are managed by signs_lib (
/giveme getname:stamper, right-click something that's not a sign to configure, and left-click a sign to stamp a new name on the sign).
The names are chosen from text files in the mod's 'lists' directory, which can be modified to add or remove names. It's also easy to add new lists and API functions, so it can be used to generate any composite string values from large lists.
It currently provides the following convenience functions: -
forename() - return a forename (any gender) surname() - return a surname genderlessName() - return genderless forename feminineName() - return feminine forename masculineName() - return masculine forename dogName() dogNameFemale() dogNameMale() catName() catNameFemale() catNameMale() -- Use like this... local myKitty = getname.catNameFemale()
These functions may be invoked by name using
getnameCall() as follows: -
local myKitty = getnameCall('catNameFemale')
It also adds a chat command that outputs the chosen name to the player's chat window: -
The current list of place-name generators is as follows: -
place_village, place_street, place_hamlet, place_hill, place_mountain, place_wetland, place_coastal, place_island
These can also be used with
Alternatively, programmatically, use
local myVillage = getnameCall('place_village')
I'm undecided, but I think getnameCall() should be the main API. Having two ways to call a function can be confusing.