[Mod] NameGen [0.1] [namegen]

cronvel
Member
 
Posts: 18
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

[Mod] NameGen [0.1] [namegen]

by cronvel » Fri Nov 29, 2019 11:40

NameGen is an API mod allowing one to generate names, a kind of markov generator with some modifications.
Basically, you give it a list of names, and it can generate names that are not in the original list, but looks similar, in the same veins.

I have done this mod for the mobs mods, like mobs_humans or aliveai, so they can have more meaningful names.

How to test it:
Once in game, open the console and type: /test_namegen <generator name>.
It comes with a builtin generator named "elf", so you can type: "/test_namegen elf" on a bare install.

How to use it in your mod:
namegen.load( generator_name , [file_path] ) : load a generator and assign it a name
namegen.generate( generator_name ) : return a string from that generator or return nil if the generator does not exist.

How to create new generators:
To generate names, the generator needs a graph file in the JSON format.
That generator is a port of a Javascript/Node.js generator of mine, but only the generator part is ported, not the graph-making part.

So to create a new graph, one have to use the original Node.js project: Nomi Ninja.
To install it, you needs Node.js (and of course Npm, which comes with it).
Code: Select all
git clone https://github.com/cronvel/nomi-ninja
cd nomi-ninja
npm install


To create a new graph, copy and modify a config found in /sample, e.g. /sample/elf.kfg.
Then export the graph with this command:
Code: Select all
./bin/nomi-ninja my-source.kfg --export > my-graph.json

Copy the JSON in your mod directory and load it with namegen.load().

Some names created with the builtin elf generator:
Thrandilman
Horiand
Mánduil
Elviolil
Vondil
Elyn
Cylduilmad
Eowith
Lómowaril

None of those names were in the original list.

Source: Gitlab repo
ContentDB: cronvel/namegen
License: MIT
Last edited by cronvel on Sat Nov 30, 2019 07:48, edited 2 times in total.
 

User avatar
Melkor
Member
 
Posts: 328
Joined: Sat Sep 24, 2011 01:03
Location: Underground
 

User avatar
Hamlet
Member
 
Posts: 656
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] NameGen [0.1] [namegen]

by Hamlet » Fri Nov 29, 2019 14:53

cronvel wrote:Some names created with the builtin elf generator:
Thrandilman
Horiand
Mánduil
Elviolil
Vondil
Elyn
Cylduilmad
Eowith
Lómowaril


Wonderful! Thanks for porting it, I'm going to have fun with this :)
 

User avatar
Lone_Wolf
Member
 
Posts: 2216
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

cronvel
Member
 
Posts: 18
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel
 


Return to WIP Mods



Who is online

Users browsing this forum: MSN [Bot] and 7 guests