• Hello game master! Welcome to our growing community. Please take a moment to Register (top right button).

    If you use Campaign Logger, you can use the same login details - we've linked the app to this forum for secure and easy single sign-on for you.

    And please drop by the Introductions thread and say hi.

Somebody help me with this snippet

Hey there, I've been meaning to add a random name that I plan to add as a part to a generator I've already made and it refuses to work. Johnn said he didn't know what was wrong with it either. Can somebody help?

{
"name":"RandomOne",
"resultPattern":"{nmZero}"
{
"name": "nmZero",
"entries": [
"{nmOne}{nmTwo}{nmThree}{nmFour}{nmFive}",
"{nmOne}{nmSix}{nmSeven}{nmEight}{nmFive}"
]
},
{
"name":"nmOne",
"tables": [
"B",
"C",
"D",
"F",
"G",
"H",
"J",
"K",
"L",
"M",
"N",
"P",
"R",
"S",
"T",
"V",
"W",
"Z"
]
},
{
"name":"nmTwo",
"tables": [
"oo",
"a",
"o"
]
},
{
"name":"nmThree",
"tables": [
"",
"d",
"n",
"r",
"l",
"b",
"k"
]
},
{
"name":"nmFour",
"tables": [
"b",
"d",
"k",
"p",
"r"
]
},
{
"name":"nmFive",
"tables": [
"y",
"ey"
]
},
{
"name":"nmSix",
"tables": [
"ee",
"i",
"o"
]
},
{
"name":"nmSeven",
"tables": [
"",
"n",
"s",
"l",
"b",
"m",
"p"
]
},
{
"name":"nmEight",
"tables": [
"k",
"n",
"s",
"l",
"m",
"p"
]
}
]
}
 

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Hey there, I've been meaning to add a random name that I plan to add as a part to a generator I've already made and it refuses to work. Johnn said he didn't know what was wrong with it either. Can somebody help?
There were a couple of issues:
  • The tables array should occur only once and contain all the tables in the generator.
  • The table definitions should list the options in an entries array (instead of a tables array).
  • A comma is needed after the resultPattern definition.
With these changes the generator works fine:
Code:
{
  "name": "RandomOne",
  "resultPattern": "{nmZero}",
  "tables": [
    {
      "name": "nmZero",
      "entries": [
        "{nmOne}{nmTwo}{nmThree}{nmFour}{nmFive}",
        "{nmOne}{nmSix}{nmSeven}{nmEight}{nmFive}"
      ]
    },
    {
      "name": "nmOne",
      "entries": [
        "B",
        "C",
        "D",
        "F",
        "G",
        "H",
        "J",
        "K",
        "L",
        "M",
        "N",
        "P",
        "R",
        "S",
        "T",
        "V",
        "W",
        "Z"
      ]
    },
    {
      "name": "nmTwo",
      "entries": [
        "oo",
        "a",
        "o"
      ]
    },
    {
      "name": "nmThree",
      "entries": [
        "",
        "d",
        "n",
        "r",
        "l",
        "b",
        "k"
      ]
    },
    {
      "name": "nmFour",
      "entries": [
        "b",
        "d",
        "k",
        "p",
        "r"
      ]
    },
    {
      "name": "nmFive",
      "entries": [
        "y",
        "ey"
      ]
    },
    {
      "name": "nmSix",
      "entries": [
        "ee",
        "i",
        "o"
      ]
    },
    {
      "name": "nmSeven",
      "entries": [
        "",
        "n",
        "s",
        "l",
        "b",
        "m",
        "p"
      ]
    },
    {
      "name": "nmEight",
      "entries": [
        "k",
        "n",
        "s",
        "l",
        "m",
        "p"
      ]
    }
  ]
}
Sample output:
Kinsey
Honny
Hospey
Gompy
Geemy
Zosley
Congrats! (y)
 
Last edited:
Top