A Gendered Name Generator
Restructuring the Codex
We are currently moving articles around and changing the general structure of the Codex. Please come back later if you get lost!Tutorial: Random Generators (Part 2)
In this tutorial, we will create a random generator that creates a male or female variant of a name depending on which gender is picked.
This tutorial will reuse the two generators and the first template created in the previous template. For this tutorial you will first have to create two additional generators, first to generate a gender and second to pick a male first name. Then these generators are combined with a router and two more simple templates.
Generator: First Name (Male)
First step is to add a new generator which adds male names. Follows the exact same pattern as the female first names.- Title: English First Names (Men)
- Description: A short list of common English names for Men.
- Type: String
- State: Public
- Tags: #english,#names,#male,#example,#tutorial-2
- JSON Payload: Payload - Click to Expand
{ "values": { "val2": "James", "val3": "Robert", "val4": "John", "val5": "Michael", "val6": "William", "val7": "David", "val8": "Richard", "val9": "Joseph", "val10": "Thomas", "val11": "Charles" } }
Generator: Gender
In the second step we add a generator for gender. This generator provides the variable for the router. It is important that the keys (colored in red) are exactly this.- Title: Gender
- Description: Generates male or female.
- Type: String
- State: Public
- Tags: #gender,#example,#tutorial-2
- JSON Payload: Payload - Click to Expand
{ "values": { "male": "male", "female": "female" } }
Template: Full Name (Male)
Following the same steps as the- Title: English Full Name (Man)
- Description: A template to generate one English name for Men.
- Type: Simple
- State: Public
- Tags: #names,#male,#example,#tutorial-1
- Content: Do NOT copy this code into your template. It will work, but will use the example generators created by me (SoulLink). Instead use the steps below to copy each generator BBCode. The second generator was created in the previous tutorial.
[generator:english-first-names-28man29-soullink|{}|first-name] [generator:english-last-names-soullink|{}|last-name]
Router: Gender to Name
Creating a router does not differ much from generators. It has less options but follows the same pattern. The important part here is to match the key to the key in the input- Title: English Full Name (Gender)
- Description: A router that selects a full name template based on gender.
- Type: Template, Simple
- State: Public
- Tags: #example,#names,#tutorial-2
- JSON Payload: Do NOT copy this code into your router directly. It will work, but will use the example templates created by me (SoulLink). Instead use the steps below to copy each template BBCode and adjust them. The second template (female) was created in the previous tutorial.
{ "source": { "male": "english-full-name-28man29-soullink", "female": "english-full-name-28woman29-soullink" } }
Template: Putting it Together
This last template will generate four lines of text and is what will be used as the Random Generator in this case.- Title: English Character
- Description: This templates creates a character with a gender and a fitting name.
- Type: Template, Simple
- State: Public
- Tags: #example,#names,#tutorial-2
- JSON Payload: Do NOT copy this code into your router directly. It will work, but will use the example templates created by me (SoulLink). Instead use the steps below to copy each template BBCode and adjust them. The second template (female) was created in the previous tutorial.
--Gender::[generator:gender-soullink|{}|gender]-- --Name::[router:english-full-name-28gender29-soullink|{"source":"gender"}|name]--
Comments