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

GMRoll Macro not evaluating

Hey Guys. I'm on the wiki page trying to sort out a silent challenge macro. It's GURPs for context. I want a macro that rolls 3d6+modifer<=number_to_beat. This way I can more easily decide challenges on the fly for when my PCs catch me off guard, or if I want to inform specific characters on perception rolls. The macro I have so far is `/gmroll 3d6+?{Modifier|0}<=?{Number to Beat|14}` The input dialogs and roll works out well! However, the final roll is not evaluated against the "Number To Beat". Example of output here: I must be doing something syntactically wrong here. Anyone see where I'm messing up?
1590970797

Edited 1590970981
Oosh
Sheet Author
API Scripter
Okay, so what the success/failure operation compares to is each individual die roll. I don't think there's a way to use the operator on a modified result, but happy to be shown I'm wrong about that if anyone knows how! So even if you get your code to work (which you can) it will compare {1d6+Modifier}>14; {1d6+Modifier}>14; {1d6+Modifier}>14. Obviously a single d6 roll is unlikely to beat a 14 without a massive modifier, so you will never get a success. I think the only option is to eyeball it manually. /w gm Roll is [[3d6+?{Modifier|0}]] vs DC[[?{Number to Beat|14}]]! To make your original idea work you would (as far as I know) have to use a 1d18, then move the modifier over to the right hand side of the equation as a negative. Obviously a 1d18 is going to completely ruin the roll distribution, so I doubt you want to do this, but here it is anyway: /gmroll 1d18>[[?{Number to Beat|14}-?{Modifier|0}]] Note that < and > always includes "or equal to" with Roll20 dice references.
1590972815

Edited 1590973724
Oosh said: Okay, so what the success/failure operation compares to is each individual die roll. I don't think there's a way to use the operator on a modified result, but happy to be shown I'm wrong about that if anyone knows how! So even if you get your code to work (which you can) it will compare {1d6+Modifier}>14; {1d6+Modifier}>14; {1d6+Modifier}>14. Obviously a single d6 roll is unlikely to beat a 14 without a massive modifier, so you will never get a success. I think the only option is to eyeball it manually. /w gm Roll is [[3d6+?{Modifier|0}]] vs DC[[?{Number to Beat|14}]]! To make your original idea work you would (as far as I know) have to use a 1d18, then move the modifier over to the right hand side of the equation as a negative. Obviously a 1d18 is going to completely ruin the roll distribution, so I doubt you want to do this, but here it is anyway: /gmroll 1d18>[[?{Number to Beat|14}-?{Modifier|0}]] Note that < and > always includes "or equal to" with Roll20 dice references. This has helped me write: /gmroll {1d16+2+?{modifier|0}}<?{Number to Beat|14} As 3d6 is pretty much the equivalent of 1d16+2 (as the minimum roll is 3 and the maximum is 18). The less than operator is working in this context :) - also I think I'm over complicating things with a modifier and number to beat. It could be further simplified with: /gmroll {1d16+2}<?{To Beat|14}
1590973518

Edited 1590973605
Oosh
Sheet Author
API Scripter
This has helped me write: /gmroll {1d16+2+?{modifier|0}}<?{Number to Beat|14} As 3d6 is pretty much the equivalent of 1d16+2 (as the minimum roll is 3 and the maximum is 18). The less than operator is working in this context :) Thank you! It's a very different distribution - with 1d16+2 you have an even chance of rolling any number between 3 and 18. If you google "3d6 distribution" you'll see the fairly marked difference - the idea of 3d6 is to make the outcome more predictable, with most results landing towards the middle. Obviously it's totally up to you how you want to run your game, but it's a pretty big difference in the underlying math for your core rolls - if your players are conservative with skill use and tend to only attempt something when their success chance is reasonably high, they will fail more with a 1d16+2 system. Some players may not like this.
Oosh said: This has helped me write: /gmroll {1d16+2+?{modifier|0}}<?{Number to Beat|14} As 3d6 is pretty much the equivalent of 1d16+2 (as the minimum roll is 3 and the maximum is 18). The less than operator is working in this context :) Thank you! It's a very different distribution - with 1d16+2 you have an even chance of rolling any number between 3 and 18. Fair enough. I'll just stick to eyeballing this instead.  Thanks for the help :)
1590976251

Edited 1590976264
GiGs
Pro
Sheet Author
API Scripter
There is a way to do this, but its a bit convoluted. Set of a rollable table, with the name 3d6. Set its items and probabilities as  Item: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Weight: 1 3 6 10 15 21 25 27 27 25 21 15 10 6 3 1 Then use this macro /gmroll {1t[3d6]-(?{Modifier|0})}<?{Number to Beat|14} or /gmroll {1t[3d6]}<[[?{Number to Beat|14}+(?{Modifier|0})]] I assume the modifier is supposed to make it easier to succeed which is why the it has a negative in the first version. Note that the macro uses < , not <= : in roll20, < means "less than or equal".  <= is not valid syntax.
GiGs said: There is a way to do this, but its a bit convoluted. Set of a rollable table, with the name 3d6. Set its items and probabilities as  Item: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Weight: 1 3 6 10 15 21 25 27 27 25 21 15 10 6 3 1 Then use this macro /gmroll {1t[3d6]-(?{Modifier|0})}<?{Number to Beat|14} or /gmroll {1t[3d6]}<[[?{Number to Beat|14}+(?{Modifier|0})]] I assume the modifier is supposed to make it easier to succeed which is why the it has a negative in the first version. Note that the macro uses < , not <= : in roll20, < means "less than or equal".  <= is not valid syntax. There's a lot to unpack here! I appreciate your feedback. I see you're a pro/sheet author. I'm embarrassed to admit that I'm far stronger with HTML/CSS/JS than I am with whatever syntax we're parsing here. An unrelated question: How much freedom do you have once you've learned the API?
1590996613
Oosh
Sheet Author
API Scripter
/gmroll {1t[3d6]-(?{Modifier|0})}<?{Number to Beat|14} or /gmroll {1t[3d6]}<[[?{Number to Beat|14}+(?{Modifier|0})]] Huh, I really didn't think that first one would work. I thought the < success operation would ignore the -?{Modifier} and just compare to the table roll. Useful!
1591017778

Edited 1591018010
GiGs
Pro
Sheet Author
API Scripter
Tratz said: GiGs said: There is a way to do this, but its a bit convoluted. Set of a rollable table, with the name 3d6. Set its items and probabilities as  Item: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Weight: 1 3 6 10 15 21 25 27 27 25 21 15 10 6 3 1 Then use this macro /gmroll {1t[3d6]-(?{Modifier|0})}<?{Number to Beat|14} or /gmroll {1t[3d6]}<[[?{Number to Beat|14}+(?{Modifier|0})]] I assume the modifier is supposed to make it easier to succeed which is why the it has a negative in the first version. Note that the macro uses < , not <= : in roll20, < means "less than or equal".  <= is not valid syntax. There's a lot to unpack here! I appreciate your feedback. I see you're a pro/sheet author. I'm embarrassed to admit that I'm far stronger with HTML/CSS/JS than I am with whatever syntax we're parsing here. An unrelated question: How much freedom do you have once you've learned the API? Actually what I'm proposing isnt coding at all. In the macros sidebar, at the bottom is the Rollable Tables section. as in the rightside of this screenshot: Just create a new table, and click on the new table to get the form shown at the top left. Set its name to 3d6. Then Add Items: you'll get a popup as on the bottom left. In the name column, enter 3, in the weight column enter 1. And save it. Then add item again, enter 4 and 3 respectively. Save it. And so on until you;ve gone through all the 3-18 results as shown in my previous post. Then Save Changes on the table and you're ready to use the macro i posted.
1591017959
GiGs
Pro
Sheet Author
API Scripter
Tratz said: An unrelated question: How much freedom do you have once you've learned the API?  Once you have learned the API, you have a LOT of freedom. There's some things that you still cant do - mostly relating to the user interface itself. But you can manipulate just about everything inside the interface. Of course you need a Pro subscription to use the API, and that gives an even stronger benefit: you dont have to write all your API scripts yourself. There are some amazing scripts that other users have already created that will massively improve you use roll20, and you have access to them all.
1591018514
GiGs
Pro
Sheet Author
API Scripter
Oosh said: /gmroll {1t[3d6]-(?{Modifier|0})}<?{Number to Beat|14} or /gmroll {1t[3d6]}<[[?{Number to Beat|14}+(?{Modifier|0})]] Huh, I really didn't think that first one would work. I thought the < success operation would ignore the -?{Modifier} and just compare to the table roll. Useful!  In group rolls it will apply arithmetic modifiers once per die, and the rollable table is considered a single die here. The modifier query is just a number like any other arithmetic modifier.
Amazing. Thanks again!