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

Macro help? On d20 roll, an even number executes second macro

1459660032

Edited 1459661644
Hi, Loving Roll20, and did lots of research in Forums and Help files.... but still can't wrap my head around the macro i am trying to create. Playing 13th Age, but it's not a game-specific macro, i don't think. My ranger has the Double Melee Attack skill, which in 13th Age allows an immediate second free attack, but ONLY if the first attack roll is a natural even number on a d20. So is there a way to add a second Attack macro after the first one, based on that condition (or IF  2, 4, 6, 8, 10, 12, 14, 16, 18, 20)? It will get more complicated, because there is a conditional bonus modifier on the second attack. But one thing at a time? Here is what i tried: /em swings his sword toward his opponent! /roll 1d20 + 5 vs AC If the sword bites deep, it causes the following Damage: /roll 1d6 + 4 ?{Was the first sword attack result an even number?| No, [[0]]| Yes - attack again with bonus,[[#DMA1]]| Yes- attack again no bonus, [[#DMA2]] } I like the idea of a QUERY, but it needs to come after the display of the first attack's results. The QUERY is only to allow me the option to use the bonus or not on the second attack (if applicable).  But in my tests, the query popped first, before the first attack, and then didn't even execute the secondary and tertiary macros. So are there if/then statements in Roll20? Help? P.S. The #DMA1 and #DMA2 macros are simply another indentical [1d20 + 5 vs AC]  basic attack macro, but with and without a "momentum" type bonus, respectively. Here they are, in case you want them: #DMA1 /em whirls toward a new enemy, and uses his handaxe to wildly stike again for a second blow! /roll 1d20 + 7 vs AC A hit causes Damage: /roll 1d6 + 4 #DMA2 /em strikes again, using his handaxe for a second blow! /roll 1d20 +5 vs AC A hit causes Damage: /roll 1d6 +4
1459667397
Andrew C
Marketplace Creator
So you want a 50-50 result... [[ Stuff for Attack 1 ]] [[ 1d20cs>10 ]] [[Add extra damage as a Critical based on this roll]]
1459668381

Edited 1459669913
To clarify, i do not want a 50-50 result exactly. It ends up being a 50% chance, true... but the additional free attack is only allowed on an even number of the Attack 1's d20. I tried your idea the first part of your idea: Attack 1 (of 2) /roll 1d20 + 5 vs AC Damage 1 (of 2) /roll 1d6+4 [[ 1d20cs>10 ]] ... but it doesn't seem to do anything but add a number that doesn't mean anything. So i added the second half: [[ 1d20cs>10 ]] [[#DMA1]] ... but get: "SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "o" found." I get the feeling i don't have it yet. :(
I figured it out! I did it in 2 steps, with 5 macros, lol: Macro 1: "First attack" /em enters the fray, wielding both sword and axe! First, his sword cuts at the enemy! (Attack 1 of 2) /roll 1d20 + 5 vs AC If Caj's sword bites into his foe, he causes DAMAGE: /roll 1d6+4 Then with visial observation, i mark if the result of the First Attack's d20 roll is even or odd and regardless of the result, execute the second macro: ?{Was the first attack a natural EVEN roll?|Nope - DMA failed,#DA-Fail |Yes - attack SAME target,#DA-Same |Yes - attack DIFFERENT target,#DA-Different } Which allows me to indicate if the result was ODD, EVEN, or EVEN with the bonus: Odd, is a failure, so: *Caj fumbles with his offhand* (Attack 2 of 2 failed) EVEN on the same target is a free second attack: /em immediately strikes again, using his handaxe for a second blow! /roll 1d20 +5 vs AC If the hit is true, it causes DAMAGE: /roll 1d6 +4  EVEN on a different target is a free second attack with a +2 bonus: /em whirls toward a new enemy and uses his handaxe to wildly strike at it for a second blow! /roll 1d20 + 7 vs AC If the axe cuts deep, it causes DAMAGE: /roll 1d6 + 4 Yay! Thanks for being my sounding board! Lol.
Without access to the API and Power Cards this will be difficult. You can assign a crit score to even numbers using the the example [[1d20cs2cs4cs6cs8cs10cs12cs14cs16cs18cs20 +5]] vs AC That will highlight any even number rolled as a (Green) crit. But it wont allow any automation.  There are no stored variables inside the standard macros. You cant save a roll value to query against.  With Power Cards you can all upon a roll and set a trigger effect. Perhaps someone else has a way I have not found. You could make 2 macros for when you get the free extra attack and just click the second when you see the Highlighted roll. Good luck, Clint
The 2 macro is the way i went, Clint! Great minds think alike? Lol. I will play with the example you gave, i was unaware of the "cs" option. Now Andrew's example makes sense too. To be clear, i assume the actual code for the first "Attack 1" macro is: /roll [[1d20cs2cs4cs6cs8cs10cs12cs14cs16cs18cs20 +5]] vs AC /roll 1d6+4 Correct? I will try that now!
Ok, i played with it, and the example highlighted the sum of the natural roll and the bonus modifier, without showing the work. This is confusing because it highlights odd numbers. How? Because 4 (even) +5 = 9 (odd). Also, without the /rolling the math isn't visible to prove it. So i changed it to: /roll [[1d20cs2cs4cs6cs8cs10cs12cs14cs16cs18cs20]] +5 vs AC And it works PERFECTLY! Easier to catch the even number. My second macro (that has 3 nested macros in it), still works nicely with this update! Thanks all!!
1459678143
Andrew C
Marketplace Creator
I know that the D&D 3.5E Standard Attack Template will respond to a 'critical' in the 'Full Attack' flag, it will also trigger on a Crit to 'run the critical damage'. Diana P can let you know more, but the basics of that template is: (Name/Heading) (Blurb) (Blurb) (Attack Roll1)(Damage 1) (Critical Check 1)(Crit Damage 1) So you could potentially exploit the Critical feature of that template to load in your 'bonus damage' as part of the Crit Check, then load a 'critical weapon check' in Attack Roll 2 to get your critical damage but it would be checked every time.
1459700874
Diana P
Pro
Sheet Author
Yes, the D&D3.5 (and many other character sheet's) attack roll template is programmed to respond to critical successes and failures.  And you probably could set up something like this in it, but you have to either be using the character sheet template (so the D&D3.5 character sheet) that it is programmed into or the campaign creator must have a Pro level subscription to allow custom character sheet template code.  Every roll template beyond the default one is programmed into one of the character sheet templates by its author. The default template, however is not programmed to react to critical successes and failures.  It displays information in columns. (Pardon typos; on my phone)