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 .
×
The developers are currently investigating an issue with logging in + accessing the VTT.
Create a free account

Have roll set up in mind- Not sure if it can be done with a Macro or if it would require API

Looking for a some help for a macro for a homebrew game I am planning. Honestly not sure how difficult it would be. What I am hoping to do would be to set up the number of various dice so it could be tweaked in a drop down when rolled. Specifically with "x" being the number of dice to be rolled in the following: (xd6+xd12+xd4) - (xd8+xd20) If it requires an API will post in that Forum instead.  Regardless any help would be appreciated.
1625448155
GiGs
Pro
Sheet Author
API Scripter
If x is the same number in all of them, you can just use a query. /roll (?{Number of Dice?|1}d6+?{Number of Dice?}d12+?{Number of Dice?}d4)-(?{Number of Dice?}d8+?{Number of Dice?}d20} If you want a dropdown to select the dice you can do it too: /roll (?{Number of Dice?|1|2|3|4|5}d6+?{Number of Dice?}d12+?{Number of Dice?}d4)-(?{Number of Dice?}d8+?{Number of Dice?}d20} Note that the first time you use a query, you need to include all options, but each extra time you use it, you just need to use the name. And the name is everything before the first |, including the ? if you use one as I did here.
It would be the latter. Thank you so much for the assistance and quick response! 
Unfortunately the second one only had one dropdown and all rolled that number of dice. Like the first one, just a drop-down rather than typing the number in the box. I'd like to be able to select, for example, (2d6+1d12+0d4) - (1d8+1d20) for one roll and then change the numbers for something like (2d6+0d12+3d4) - (3d8+0d20) 
1625472241

Edited 1625557586
Ziechael
Forum Champion
Sheet Author
API Scripter
You'll need to have each query run separately in that case: /roll (?{Number of d6|0|1|2|3|4|5}d6+?{Number of d12|0|1|2|3|4|5}d12+?{Number of d4|0|1|2|3|4|5}d4)-(?{Number of d8|0|1|2|3|4|5}d8+?{Number of d20|0|1|2|3|4|5}d20})
That worked! Thank you so much! Guessing to have the selections as separate boxes all up at the same time would require an API.
1625488006
GiGs
Pro
Sheet Author
API Scripter
No, that's not even possible with the API. It's a design limitation of roll20, you can only have one dropdown or query on screen at a time.
That is too bad, but good to know. Thanks for letting me know.
1625500883

Edited 1625557576
Ziechael
Forum Champion
Sheet Author
API Scripter
You could use a token's properties GUI as a pseudo-query box... probably more hassle than it is worth but using bar1 value through to bar3 max to represent the dice query in ascending order you'd do: /roll (@{selected|bar1|max}d6 + @{selected|bar3}d12 + @{selected|bar1}d4)-(@{selected|bar2}d8 + @{selected|bar3|max}d20}) You'd need to have the token selected and edit the actual bar values and max values ahead of time but it would  be a single hit query GUI?
Will have to try that out. Sooner or later will have to get some help making a sheet for the system, just figured this sort of thing would be an easier ask for now.