Generator not rolling a result

So, I'm creating a name generator and during my testing I get blanks. I'll show an example below.

This is the blank->Tribal member is Male. Their name is .

This is a normal roll->Tribal member is Male. Their name is Irokro.

Here's the code I'm using below.

Prompt: Tribal Member Gender {Female|Male|Dragon} Dragon

table: prompt_example

Tribal member is {$prompt1}. Their name is [@Name].
Table: Name
[when]{$prompt1}=Female[do][@FemaleName][end]
[when]{$prompt1}=Male[do][@MaleName][end]
[when]{$prompt1}=Dragon[do][@DragonName][end]
Table: FemaleName
A[|a|y][@Endname]
B[|a|y][@Endname]
C[|a|y][@Endname]
D[|a|y][@Endname]
H[|a|y][@Endname]
N[|a|y][@Endname]
P[|a|y][@Endname]
Table: MaleName
A[|r|t][|o|u][@Endname]
B[|r|h][|o|u][@Endname]
E[|r|t][|o|u][@Endname]
H[|r|a][|o|u][@Endname]
I[|r|t][|o|u][@Endname]
Table: DragonName
Brakkenion
Table: Endname
10:[|k|t][|r|h][|o|a|u]
10:[|f|b][|r|e][|a|o|i]
a[|k|t][|r|h][|o|a|u]
a[|f|b][|r|e][|a|o|i]
e[|k|t][|r|h][|o|a|u]
e[|f|b][|r|e][|a|o|i]
i[|k|t][|r|h][|o|a|u]
i[|f|b][|r|e][|a|o|i]
o[|k|t][|r|h][|o|a|u]
o[|f|b][|r|e][|a|o|i]
u[|k|t][|r|h][|o|a|u]
u[|f|b][|r|e][|a|o|i]

Now I do have a custom folder for this generator but... it really didn't matter as I created a generator before that acted the same way in one of the program's regular folders. I deleted the code but the result is the same even if I put a blank line between Tables.
Anyone have a light as to what is causing this?

Comments

  • The problem is that you have put your three conditionals in the Name table on separate lines. That means IPP will randomly pick one of them to check, and ignore the others! You need to put all three on the same line like:

    Table: Name
    [when]{$prompt1}=Female[do][@FemaleName][end][when]{$prompt1}=Male[do][@MaleName][end][when]{$prompt1}=Dragon[do][@DragonName][end]
    

    Or if you like having them visually separated, end the first two lines with & to connect them:

    Table: Name
    [when]{$prompt1}=Female[do][@FemaleName][end]&
    [when]{$prompt1}=Male[do][@MaleName][end]&
    [when]{$prompt1}=Dragon[do][@DragonName][end]
    
  • Incidentally, you could omit the Name table entirely if you change the first table to:

       table: prompt_example
       Tribal member is {$prompt1}. Their name is [@{$prompt1}Name].
    

    This will call FemaleName, MaleName, or DragonName directly without needing any When statements!

  • Nice solution!

  • edited May 2019

    Well, look at that! It worked!

    New result once I figured out that the Table call wasn't in the proper spot after taking in your suggestions: ->Tribal member is Male. Their name is Haotru.

    I had some minor issues such as getting a result like "FemaleName" when I should have gotten something like "Datra".

Leave a Comment