Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

I need some help, using a randomly generated data not working...

I have a gut feeling I am doing something wrong, but I am after some assistance with a macro I am building.  I will give some background, then the code, and then an image with the results I am after. I am trying to create a stat generator.  Our games have a space cow rule, which basically means that if the character did not roll a total modifier of +3 or better, it will have the survivability of a cow exposed to the vacuum of space.  Anyway, what I am trying to do was have it roll the stats, and then calculate the modifier, and add them up.  I know we have no IF options, and this won't work with a pseudo setup, so I have to come up with something, and this is what is happening: First roll is: [[ ?{Roll1|[[4d6ro1k3]]} ]] (?{Roll1}) So as you can see the result, the first number has rolled a 13, but then when I call the result,m it seems to re-roll the dice, and I get two numbers. [[ ?{Roll1|0} ]] ([[ [[ floor (?{Roll1} -10 ]] / 2 ]])) Second one is just a proof, where it asks the value, and then does the math.  THIS one works fine, unless I change the first number to a dice roll, and then I get the same issue of two different base numbers.  [[ ?{Bonus1} ]] (?{Bonus1}) If I type in a number it works fine, however if I input a roll, same thing happens. What / How can I fix this?   So to re-cap: I want it to roll the dice, then use those to calculate the mod, and the overall total of ALL modifiers.  TIA4TH
The Image....I hope:
1540877734
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This unfortunately won't work. Dice rolls can't be reused. Because of the order of operations the value of the roll query is "[[4d6ro1k3]]" instead of 18 and so rerolls each time. You could probably do this via the powercards API script. Unfortunately I have no experience with the script.
1540877954
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You will likely need to use a custom script. The dice rolling engine does not "remember" numbers. It might be possible with the Power Cards API, I believe it can use rolls for the purposes of comparison. You could roll [[[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]]] and look for a total of 61 or higher. That's the same functionally of getting at least a +3 total, being the lowest total that will still produce a combined +3. You can then hover over the sum to read each result. They'll show up twice, because reasons, but the string of six numbers is identical.
1540904542
GiGs
Pro
Sheet Author
API Scripter
Since youre Pro , the script approach is best bet (and power cards can probably do it). That said, you could rewrite Keith's macro for a bit more clarity: /roll [[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]>61 This will show the 6 rolls visibly, and also return a "1 success" for rolls that equal 61+, and "0 success" for those that don't. The script approach is better though.
1540905341
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nice refinement, GG!
1540905824
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Needs a little more refinement. The success syntax won't work that way unfortunately. You need to group the rolls somehow. On mobile ATM, so my testing options are limited.
keithcurtis said: You will likely need to use a custom script. The dice rolling engine does not "remember" numbers. It might be possible with the Power Cards API, I believe it can use rolls for the purposes of comparison. You could roll [[[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]]] and look for a total of 61 or higher. That's the same functionally of getting at least a +3 total, being the lowest total that will still produce a combined +3. You can then hover over the sum to read each result. They'll show up twice, because reasons, but the string of six numbers is identical. BRILLIANT solution my man, thanks.  Now to go play.
G G said: Since youre Pro , the script approach is best bet (and power cards can probably do it). That said, you could rewrite Keith's macro for a bit more clarity: /roll [[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]+[[4d6ro1k3]]>61 This gives the total, but I need them individually displayed as well in the same format.... I tried doing tables, but it has the same result as doing a dice roll, with the nett result being no way to do this.  OH well...thanks anyway guys.