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

Critical Hit Macro Question

1511145279

Edited 1511145380
Just started messing with Roll20 recently and I've been writing a few basic macros for myself, other players, and the GM. My 5e character is a rogue, so I wrote this rather generic attack macro to roll my dex-based attacks: /me rolls an attack If [[ [[?{Advantage|no,1d20cf1cs20|yes, 2d20kh1cf1cs20|disadvantage,2d20kl1cf1cs20}]] + floor((@{dexterity} -10)/2) + @{prof} + ?{weapon bonus|0} ]] hits... I deal [[ ?{hit die|1d4|1d6|1d8|1d10|1d12|2d6} + ((floor((@{dexterity} -10)/2))) + [[ [[?{sneak attack|no,0|yes,1}]]*[[ceil(@{level}/2)]] ]]d6 + ?{weapon bonus} ]] damage! If it's a crit (green) I deal an extra [[ ?{hit die} + [[ [[?{sneak attack|no,0|yes,1}]]*[[ceil(@{level}/2)]] ]]d6]] I'm trying to clean this up some, and use it as an opportunity to learn more about macros in the process. My question is this: is there a way to only execute part of a macro if a die roll meets a threshold, such as rolling extra damage dice on a result of a 20? Also, I see by browsing a few of the other topics here that roll "templates" are a thing. Is there a good resource for learning more about those?
1511178873
Ziechael
Forum Champion
Sheet Author
API Scripter
The default template and standard macro syntax is a bit limited with regards to if/then functionality but checks for crits are regular features on specific sheet templates. Which sheet is your game running? OGL by Roll20 <a href="https://app.roll20.net/sheet-previews/ogl5e.png" rel="nofollow">https://app.roll20.net/sheet-previews/ogl5e.png</a> Community Contributed <a href="https://app.roll20.net/sheet-previews/dnd5e.png" rel="nofollow">https://app.roll20.net/sheet-previews/dnd5e.png</a> Shaped <a href="https://app.roll20.net/sheet-previews/dnd5eshaped2.jpg" rel="nofollow">https://app.roll20.net/sheet-previews/dnd5eshaped2.jpg</a>
I have the same question for Pathfinder, there are skills and abilities that trigers after critical hit is scored, so you have practicaly different roll... For ilustration please check core predefined Kyra character.