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

Automating dice progression with macros

hi hi I have a game system that regularly uses a numbered progression of dice.  (1d6, 1d8, 1d10, 1d10+1d2, etc.)  So if a character has a skill rating of 3, then they might roll 1d6, but if they get a bonus that increases it to skill rating 4, then they'd roll 1d8 instead. I'm trying to make a macro so my players can just enter the rating number and have roll20 produce the appropriate dice roll, but I'm not having much luck.  I tried making a macro using prompts: "#roll?{|0}"  And making another set of macros labelled 1, 2, 3, etc. for each die roll.  But it seems like there's no way to make macros reference other macros, unless I'm missing something? Assuming that making a macro that references other macros won't work, does anyone know a different way that I could make this work?
1500427751

Edited 1500428251
The Aaron
Pro
API Scripter
I'd probably approach this as a single macro with a roll query to specify the dice: [[?{Skill Rating|1,1d6|2,1d8|3,1d10|4,1d10+1d2}]]
hi hi Thank you.  That works pretty well.  The drop down menu is a little bit cumbersome, given the 20 or so total options, but it actually works.  Far and away better than my attempts. ^_^ 
1500436265
Silvyre
Forum Champion
I've written a few macros like that for Earthdawns Step Table system; if you post the progression table, I could give it a shot.
hi hi If you're interested in doing that, that would be awesome.  If you wanted to just link me an example macro, I could try tweaking the numbers too and hopefully save you some trouble. In any case, the progression table is: 1: 1d2 6: 1d10+1d2 11: 2d10+1d2 16: 3d10+1d2 2: 1d4 7: 1d10+1d4 12: 2d10+1d4 17: 3d10+1d4 3: 1d6 8: 1d10+1d6 13: 2d10+1d6 18: 3d10+1d6 4: 1d8 9: 1d10+1d8 14: 2d10+1d8 19: 3d10+1d8 5: 1d10 10: 2d10 15: 3d10 20: 4d10 (Hypothetically, that pattern continues indefinitely, but realistically the players aren't getting anything above 20.)  Thanks in advance!
1500438602
Silvyre
Forum Champion
Try this out: [[ [[floor(@{rating} / 5)]]d10 + 1d[[@{rating} * 2 % 10]] ]]
hi hi Thanks again!  Y'all are great. ^_^ It looks like that produces the correct results, and being able to type in the number is very nice.  I'm not quite to the stage where I can have a clickable character sheet, so I replaced the @ signs with ? signs to get a prompt instead.  And while I'm not sure why it worked out this way, I removed the outer brackets so that the individual dice would show up without needing a mouse over.  I also put another pair of parenthesis around the Rating query, so that people can input things like "4+1" and get the correct result. So the macro ends up looking like: /roll [[floor((?{rating}) / 5)]]d10 + 1d[[(?{rating}) * 2 % 10]]
1500480352
Silvyre
Forum Champion
Great! Happy rolling!