Is this formula correct ?

[#{1d{100+{fmod}}} 2f]
Im trying to roll on a table where the modifier can be posative or negative. It seems to work but im not sure the syntax is correct

Comments

  • It's syntactically valid, but are you trying to change the die or are you trying to add a modifier to a d100 roll?

    As written, you're changing the number of sides on the die. If fmod is -10, for example, you're rolling 1d90. If fmod is 7, you're rolling 1d107.

    If instead you want 1d100 plus a modifier: {1d100+fmod}

    If you also want the result in the 1-100 range: {min(100,max(1,1d100+fmod))}

  • edited August 2021

    OldeMusike Is there anywhere that explains the min max commands better? Ive Been trying to do a d100 roll where fmod can be anything from -10 to +40 but the chart only ranges from 1 to 140 , so if your poor you can only get a max of 90 but a minimum of 1.
    Ive checked the help file but it just examples n1, n2 etc not sure what the verious N represents.
    Ive basically coded the supplement background noise.

  • Max is just a list of values, separated by commas, and it returns whichever value is highest. So for example:

    max(1,2) = 2
    max(1,2,3,4,5,6,7) = 7

    You can have as many values listed there as you want. When it says max(n1,n2,...,nN) what that means is just n1 is the first value, n2 is the second value, etc all the way up to the Nth value.

    Obviously the values don't have to just be numbers, they can be anything with a numeric value. So

    max(1,{1d100-50})

    will return either the random number {1d100-50}, or a 1 if the random number was less than that.

    Min is the same, except it returns the lowest value.

  • A d100 roll plus a modifier, with anything below 1 treated as 1, and anything higher than 140 treated as 140: {min(140,max(1,1d100+fmod))}

    jdale's explanation is spot-on. The max function as I use it above gives you 1 or 1d100+fmod, whichever is higher. The min function gives you that result or 140, whichever is lower. No matter how high or low fmod is, the result will be in the 1 to 140 range.

Leave a Comment