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

Target Rolls in Macro

I am trying to create a Macro to decide on success or failure. I have read the various descriptions of creating macros. I understand the <=> rolls. I have tried to do "/roll 3d6<target". Target being an ability from the character sheet, say Perception. It only looks at the individual d6 rolled. I want it to compare the full 3d6 sum. I have tried to use (), but it doesn't group the number and use the <=>. It only groups the number.
1595394292

Edited 1595394322
GiGs
Pro
Sheet Author
API Scripter
Unfortunately, you cant do that without a custom API script, or calculating the odds of your 3d6 roll and putting it in a rollable table format.
1595493538
GiGs
Pro
Sheet Author
API Scripter
While answering another question, I realised there is a way to do this. /roll {3d6,0d0}kh1<target You can use a group roll to get the highest of two or more dice sets. if you use 0d0, roll20 thinks its a dice roll, but its just the value of 0. So /roll {3d6,0d0}kh1 Is the same as rolling 3d6 and taking the result. And you can compare that to a difficulty using the > or < operator.
tried that. It will give you the highest roll as the KH1 typically works, but it ignores the operators after that
1595548891

Edited 1595549009
Kavini
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Interestingly, GiG's answer works for me. Perhaps this will work instead? /r {3d6,{0}}kh1>5
1595558470

Edited 1595558720
Oosh
Sheet Author
API Scripter
GiGs' suggestion also works for me. What are you using in place of "target", can you share your full code? If your "target" is another dice roll you will need to wrap that in some [[ ]] brackets to give the success operator an integer. Nic's version also works. [[ {[[3d6]],0}kh1>[[1d10]] ]] success, (roll total $[[0]] vs $[[1]]) Another variation for inline rolls in templates. PS - Thanks GiGs! I did not know it was possible to get the success operator to work this way! Is this Stupid Tricks worthy, or am I the only dunce who wasn't aware of this?
1595563084
GiGs
Pro
Sheet Author
API Scripter
Nic B. said: Interestingly, GiG's answer works for me. Perhaps this will work instead? /r {3d6,{0}}kh1>5 I like that way of representing 0s over 0d0, I think I'll start using it. Oosh said: PS - Thanks GiGs! I did not know it was possible to get the success operator to work this way! Is this Stupid Tricks worthy, or am I the only dunce who wasn't aware of this? I didnt know it was possible either, till I realised it while answering an unrelated question yesterday. I am pretty sure I've given the same incorrect advice i gave in the first post before, and no one has called me out on it, so maybe it is stupid tricks worthy.
1595563634

Edited 1595563674
Oosh
Sheet Author
API Scripter
Yeah, I'm remembering at least a couple of threads where the advice was "No, you can't do it - success operator only works on die rolls", and no one disputed it. Extrapolating from how terrible my memory is, there are at least 2,000 threads with bad advice in them.
I guess my last post was not totally correct. While it shows a success, it is incorrect. I think it is considering the 0d6 as the success. I think I will try a high roll that will always give my greater than the 18 of a 3d6 roll. then change it to keep lowest roll. Not sure what the problem is. From the example, if I had uesd <= it would be right. Maybe the rounding the roll is doing from the random roll is what is causing it.
1595649639
GiGs
Pro
Sheet Author
API Scripter
That is what's happening. I forgot to switch the target to the other side. I'm on my mobile now so it's hard to post code, but find the stupid tricks thread, the last post there is by me and shows this technique with the correct code.
thanks
1595652224

Edited 1595652285
GiGs
Pro
Sheet Author
API Scripter
Wait a moment! Now that Ive woken up a bit more, I realise the original post was correct. This should be working for you: /roll {3d6,0d0}kh1<target /roll {3d6,{0}}kh1<target If they aren't, can you post exactly what you are typing, with a screenshot of the chat result?
1595652419
GiGs
Pro
Sheet Author
API Scripter
The screenshot you posted above shows the macro working properly.  In roll20, the < operator does not mean "roll under". It means (confusingly) "roll equal to or under". There is no <= operator. So your screenshot shows 1 success, with a roll of 10 vs a target of 10, and that is exactly what you should be getting.
I was just reading that in the help. Thanks for the info. Getting into the macros and thinking I understand things, then something simple like that messes me up.
1595744169
GiGs
Pro
Sheet Author
API Scripter
It's very easy to be caught out by that, it's just not expected at all.