How do I add a Variable to a dice roll?

I'd like to have a table roll in the form:

Table: TabName
Roll: 1d100+{$Mod}

But this generates an error. Is it possible to add a variable number to the roll. Or is there a workaround

Thanks in advance,


  • set: diceroll=[@dieroll]
    table: dieroll
    Roll: 1d100+{$Mod}

    or you call have the dieroll table call act as a variable itself if only used once.
  • This doesn't work!


    table: dieroll
    Roll: 1d100+{$Mod}

    Generates a 'd must be an integer value' error.
  • Hi all,

    Hate to add a "me too" post, but I had a similar issue and saw this thread. I think the larger question is: "How do you designate a variable as a number?"

    I have a table where the selected prompt value determines the number of times IPP rolls on a sub-table. Something like:
    Prompt: Wilderness Type {Water|Swamp|Desert|Grassland|Forest|Hills|Mountains} Grassland
    Table: Terrain
    Set: WaterRolls = 2
    Set: SwampRolls = 4
    Set: DesertRolls = 2
    [@{${$prompt1}Rolls} {$prompt1}Encounters]

    Then there's an encounter sub-table for each wilderness type (i.e., WaterEncounters, SwampEncounters, DesertEncounters, etc.).

    I can verify that the variable is assigned correctly, but when it comes time for table rolls, the variable assignment is not interpreted as a number. As a result, IPP doesn't roll on any sub-table.

    Is there a way to do this?

  • I dont think you can put a variable in the Roll: statement for a table. What you'd want to do is explicitly roll on a table using a table pick and passing the dice expression into the table call.

    I've attached below the generator I use for my Conan RPG campaign to create endless bandit hordes and enemy soldiers. It has a lot of math expressions, being essentially a simple d20 character generator, and does a lot of the style of table rolls I'm talking about.

Leave a Comment