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

Detecting crits and rolling/using keep roll

Okay so, i've been here to the forums before, and everything i've asked about has been generally impossible without the API. I'm hoping this isn't, and...to be honest, I may have already asked this one before. Is it possible to set a macro up so that it detects a natural 20 and then rolls a specific macro? EI: /r [[1d20+9]] /r [[1d8+2d10+7]] If it's a natural 20, then it also needs to roll: /r [[3d8+6d10+21]] and add it to the damage, [[1d8+2d10+7]]. My second question...I need to have a...more complicated macro that asks a bunch of stuff and then rolls it twice and keeps the highest roll...it's...a lot easier just to show you what i've written. ?{What type of check is it?} Check /r [[1d20?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max} |Intelligence, @{Morgran Glintshield|Intelligence|max} |Dexterity, @{Morgran Glintshield|Dexterity|max} |Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} |Strength, @{Morgran Glintshield|Strength|max} |Sanity, @{Morgran Glintshield|Sanity|max}} ?{With Proficiency?|Yes, @{Morgran Glintshield|Prof Bonus}|No,  |Stonecunning Check, @{Morgran Glintshield|Prof Bonus}*2}?{Is it a saving throw and are you conscious?|Yes, @{Morgran Glintshield|Charisma|max}|No, }]] ?{Do you have advantage?|Yes, /r [[1d20?{Which Check will you use?} ?{With Proficiency?} ?{Is it a saving throw and are you conscious?} ]]|No,  } Basically, I need it to go through all the questions, and then load what the answers were into the second part, that is, if you select "Yes" for "Do you have advantage?", and then group the first 1d20?... with the advantage rolls and keep the highest. Everything I tried told me I had an error in my macro. I already have it so that it asks you the questions, saves it, and inserts the same answers/values into the second part of the macro (?{Do you have advantage?), so when you run the macro, it will take the values you input and run two of the rolls. I just wanted to take it a step further and report only the higher value. Thanks in advance for any help and or replies.
1487913663
Tetsuo
Forum Champion
What character sheet is used in your campaign? Some have templates to make special rolls based on nat 20s
Quick question of my own before I get to yours: why are you combining rolls (/r) with inline rolls ([[]])? You don't need to. Are you trying to achieve a particular visual effect by doing so? For instance, you don't need to type /r [[1d100]] You can just type /r 1d100 or [[1d100]] Now on to your questions. The short answer is no, the macro system can't trigger contingency rolls. Roll20 appears to have been designed to mimic the tools one has at the tabletop, and critical success on real dice don't automatically roll bonus damage themselves. What one typically does is roll and display the attack roll, then roll and display the damage roll, and it's up to the players to recognize whether to apply damage or not. In your case this would look something like this: To hit: [[ 1d20 + 9 ]] Damage: [[ 1d8 + 2d10 + 7 ]] Critical Damage: [[ 1d8 + 2d10 + 7 + 3d8 + 6d10 + 21 ]] If the "to hit" roll is outlined in green, you read the Critical Damage line instead of the Damage line. There are certain tricks you can use to generate contingency numbers, but you can only use the results of a roll once.  For instance, if there were no critical damage component to your macro, you could do something like this: Damage: [[ [[ { 1d20 + 9 }>?{Score needed to hit} ]] * ( 1d8 + 2d10 + 7 ) ]] In this example, the macro asks you what score you need to hit, then rolls 1d20+9. If total is at least the score to hit, the entire inner inline roll resolves to 1; otherwise it becomes 0. This 1 or 0 is then multiplied by the damage roll. You either get 0 damage (meaning the hit was not successful) or a number greater than 0, which means it was a hit. But I can't also  check for a critical success, because that would require reusing the d20 roll elsewhere, and you can't do that. However, you can do something else that maintains the same probabilities. You get a natural 20 on 5% of rolls. Your hit conditions are either hit or miss. Therefore it doesn't actually matter whether the 5% is generated with the to-hit roll or not. Ignore the natural 20 on the attack roll and roll another d20 for that 5%: Damage: [[ [[ { 1d20 + 9 }>?{Score needed to hit} ]] * ( 1d8 + 2d10 + 7 ) ]] Bonus Damage: [[ [[ 1d20>20 ]] * ( 1d8 + 2d10 + 7 ) ]] You still have to add these in your head, though, since the macro has no way to not add Bonus Damage to Damage if Damage is 0. On to your second question. Your macro appears to have some errors. You do something like this several times: 1d20?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max}... Let's suppose Morgran's Wisdom is 15. That code above resolves to "1d2015". You need to add some arithmetic operators. 1d20 + ?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max}... And so forth. Roll queries simply take the text of whatever response they get and substitute it into the macro in its place. They don't perform any calculation, they just substitute text.
1487961991

Edited 1487962405
OKay so, the way this works is the Wisdom value is actually, for example, 15, and the max value for it reads "+2". So what it actually does is do 1d20(Morgran's max reads "+2")+2 when it's all read, and it outputs the right thing. I also had it so that is asks the "Prof Bonus", or, the proficiency bonus, and adds that if you select "Yes" for "Do you have proficiency?". In this case, his proficiency reads "+3", and i've got the whole thing set up kinda like this. I have the macro I sent you working completely, I just need a way for it to automatically read is as if it were a "k1" roll when you select "Yes" for advantage. Also, for the first macro, I was going for the visual effect, I didn't want to clutter the chat with all the numbers in the roll, just what it ended up as. I do realize that what I was asking was probably impossible, I just...wanted to hope.
I can't quite follow your macro. There are line breaks in odd places that I'm not sure you intended. Can you do a straight copy and paste in the code paragraph style?
1487963194

Edited 1487963424
Sorry, I just follow a certain way when I write my macros. Can do, although for the most part, it is one continuous line. I put a break between "?{What type of check is it?} Check" and   "/r [[1d20?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max} |Intelligence, @{Morgran Glintshield|Intelligence|max} |Dexterity, @{Morgran Glintshield|Dexterity|max} |Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} |Strength, @{Morgran Glintshield|Strength|max} |Sanity, @{Morgran Glintshield|Sanity|max}}" because I wanted it to output on two different lines, the first would output something like "Religion Check", and then on the next line, it would start the roll for the actual ability check roll. the only other break is at the very end where it asks you if you have advantage, because that makes it roll the exact thing you input earlier, while still rolling a d20, letting you see the two different rolls and see which one is higher. Here's the macro with no breaks. ?{What type of check is it?} Check (break) /r [[1d20?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max} |Intelligence, @{Morgran Glintshield|Intelligence|max} |Dexterity, @{Morgran Glintshield|Dexterity|max} |Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} |Strength, @{Morgran Glintshield|Strength|max} |Sanity, @{Morgran Glintshield|Sanity|max}} ?{With Proficiency?|Yes, @{Morgran Glintshield|Prof Bonus}|No, |Stonecunning Check, @{Morgran Glintshield|Prof Bonus}*2}?{Is it a saving throw and are you conscious?|Yes, @{Morgran Glintshield|Charisma|max}|No, }]] (break) ?{Do you have advantage?|Yes,/r [[1d20?{Which Check will you use?} ?{With Proficiency?} ?{Is it a saving throw and are you conscious?} ]]|No, } Also, we use just the normal, minimalistic character sheet. We've tried the others and...we didn't like them.
Sorry, I still can't follow it, and it really looks like bits are missing. Since I don't know the logic behind the roll you're trying to make and I can't piece it together from the macro, I won't be able to help further. Maybe someone else knows what you're trying to accomplish and can help. The general way to choose the higher of two complex rolls is to put the rolls into {} and separate them with a comma. Then put kh1 after the {}.
Okay. The way I built this macro is for making ability checks/saving throws. A dialog comes up askign what type of check it is, and whatever you input will come up on the first line, saying "[input] Check". The next line brings up a gui that has a drop down menu, and it's got Charisma, Strength, etc on it, and each selection is tied to the character sheet of Morgran, where those values are stored. Say I wanted to do a strength check. The roll that is actually outputed would be /r [[1d20@{Morgran Glintshield|Strength|max}]], which would output /r [[1d20+4]]. The way I have it set up, you can roll like this for any of your character's ability scores. the "max" part actually outputs a plus or minus and their ability score modifier, depending on what the actual score is.  the macro goes on to ask if you have proficiency with your check, for things like acrobatics and stuff. If you select yes, it also inputs the proficiency modifier for your character. In this case, Morgran has proficiency with history. So it'd be /r [[1d20@{Morgran Glintshield|Intelligence|max}@{Morgran Glintshield|Prof Bonus}]], which would output /r [[1d20+2+3]]. Under proficiency, it also has stonecunning, because he's a dwarf, which makes him have double proficiency with any history checks on stonework. On top of this, it also asks if he's conscious and if it's a saving throw, because he's a paladin with Aura of Protection, which gives him his wisdom modifier added to his throw. This is the end of the second line. The last line is simply asking if you have advantage on the roll, which if you answer yes, will take all of the answers for the different parts of line two, and input them again into a separate roll. I don't know if this helped or not, I tend to overcomplicate things, but I assure you there is nothing missing from this macro, and it's been tested thoroughly, it works fine. I simply wanted to take the roll from line 2 and the duplicate from line 3 and run it as a k1 roll, so it woudl roll them, and then only show the highest roll. And I probably wouldn't need the "/r" on the third line, which I think is where my problem inlies, I could put them both on the same line separated by a comma and run the k1. I'll try this, and if I get it working, i'll reply here that i've got it. Thanks for trying though, I do appreciate it.
1487964927

Edited 1487965163
Ohhhhhhhh, you left the ends off so that we could fill it in for you! That's why bits look missing. ! ?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max} |Intelligence, @{Morgran Glintshield|Intelligence|max} |Dexterity, @{Morgran Glintshield|Dexterity|max} |Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} |Strength, @{Morgran Glintshield|Strength|max} |Sanity, @{Morgran Glintshield|Sanity|max}} ?{With Proficiency?|Yes, @{Morgran Glintshield|Prof Bonus}|No, |Stonecunning Check, @{Morgran Glintshield|Prof Bonus}*2}?{Is it a saving throw and are you conscious?|Yes, @{Morgran Glintshield|Charisma|max}|No, } /r [[ ?{Do you have advantage?| Yes, 2d20kh1 | No, 1d20} ?{Which Check will you use?} ?{With Proficiency?} ?{Is it a saving throw and are you conscious?} ]] I haven't tested this, but it looks right to me. The "!" at the beginning suppresses the first line from being displayed in the chat, but processes the roll queries anyway. Here it is word-wrapped, if that's easier: ! ?{Which Check will you use?|Wisdom, @{Morgran Glintshield|Wisdom|max} |Intelligence, @{Morgran Glintshield|Intelligence|max} |Dexterity, @{Morgran Glintshield|Dexterity|max} |Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} |Strength, @{Morgran Glintshield|Strength|max} |Sanity, @{Morgran Glintshield|Sanity|max}} ?{With Proficiency?|Yes, @{Morgran Glintshield|Prof Bonus}|No, |Stonecunning Check, @{Morgran Glintshield|Prof Bonus}*2}?{Is it a saving throw and are you conscious?|Yes, @{Morgran Glintshield|Charisma|max}|No, } /r [[ ?{Do you have advantage?| Yes, 2d20kh1 | No, 1d20} ?{Which Check will you use?} ?{With Proficiency?} ?{Is it a saving throw and are you conscious?} ]]
1487965554

Edited 1487965670
Here's an even more cleaned-up version (remove the blank lines): ! ?{Which Check will you use?| Wisdom, @{Morgran Glintshield|Wisdom|max} | Intelligence, @{Morgran Glintshield|Intelligence|max} | Dexterity, @{Morgran Glintshield|Dexterity|max} | Charisma, @{Morgran Glintshield|Charisma|max} | Constitution, @{Morgran Glintshield|Constitution|max} | Strength, @{Morgran Glintshield|Strength|max} | Sanity, @{Morgran Glintshield|Sanity|max}} ! ?{With Proficiency?| Yes, @{Morgran Glintshield|Prof Bonus} | No, | Stonecunning Check, @{Morgran Glintshield|Prof Bonus} * 2} ! ?{Is it a saving throw and are you conscious?| Yes, @{Morgran Glintshield|Charisma|max} | No, } /r [[ ?{Do you have advantage?| Yes, 2d20kh1 | No, 1d20} ?{Which Check will you use?} ?{With Proficiency?} ?{Is it a saving throw and are you conscious?} ]]
1487965673

Edited 1487965740
..I honestly have no idea why I never thought of doing it that way. This works perfectly for what I needed, except you have to insert a break before the /r part, or it hides what the roll outputs, but otherwise, it's perfect. Thanks a ton man! EDIT: I was talking about the first one you gave me, I didn't see the second one, but I tend to try to keep macros in one block anyways. So thank you.
You're welcome!