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

Rolls, tables, and copies

Why will this not work? [[ 1t[[[ 1d20&gt;[[@{target_number}]] ]]] ]]$[[0]] produces <span class="inlinerollresult showtip tipsy-n-right" original-title="Rolling 1t[1] = ( Success! )" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; font-weight: bold; cursor: help; font-size: 1.1em; color: rgb(64, 64, 64); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;">Success! 9 where @{target_number}] == 9. The&nbsp; Success!&nbsp; is from a one-row table named 1. I have another named 0 for&nbsp; Failure! I've also tried: [[1d20]][[ 1t[[[ $[[0]]&gt;[[@{target_number}]] ]]] ]] produces <span class="inlinerollresult showtip tipsy-n-right" original-title=" Rolling 1d20 = ( 6 )" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; font-weight: bold; cursor: help; font-size: 1.1em; color: rgb(64, 64, 64); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;">6 [[ 1t[[[&nbsp; <span class="inlinerollresult showtip tipsy-n-right" original-title=" Rolling 1d20 = ( 6 )" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; font-weight: bold; cursor: help; font-size: 1.1em; color: rgb(64, 64, 64); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;">6 &gt;9 ]]] ]] where the 1d20 rolled a 6. I want Success! X where X is the actual number rolled. I've scoured the forums here, but everything I've tried always seems to be one little glitch away from actually working.
To reference the d20 it needs to be in a roll on it's own. Try this [[ 1t[[[ {[[1d20]],-1}&gt;[[@{target_number}]] ]]] ]]$[[0]]
Booya! Thanks! I thought that might have been the problem. Appears I didn't know the proper syntax.&nbsp; If you don't mind a bit of teaching...how does this work:&nbsp; {[[1d20]],-1} ?
{[[1d20]],-1} That is group roll syntax . With the d20 in it's own roll you can't use the target number syntax directly. So you have to use the target number with a group roll. However the nested roll result gets treated as a plain number and not a roll and group rolls with a single "sub-roll" must have a roll expression. So there has to be a second "sub-roll" to use with target number and both of those numbers get compared to the target number. -1 was chosen for this value since it should always be lower than the target number.
Thanks. Your help is highly appreciated. Not sure I followed everything, but I'll keep at it. UPDATE: LOL. I'm almost embarrassed to bother you again. I dropped that snippet into my main macro, below (CRs and spaces for readability) When I run it, the drop down box gets populated with: Normal,Normal Task Roll&nbsp; [[ 1t[[[ {[[1d20]],-1 Main Macro: &amp;{template:default} {{name=Generic Task Roll}} {{Target#:&nbsp; [[@{target_number}]]}} {{ ?{Task Type | Normal,Normal Task Roll&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[ 1t[[[ {[[1d20]],-1}&nbsp; &nbsp; &gt; [[@{target_number}]] ]]]&nbsp; ]] $[[0]] | Advantage,Task Roll with Advantage&nbsp; &nbsp; &nbsp;[[ 1t[[[ {[[2d20kh1]],-1} &gt; [[@{target_number}]] ]]]&nbsp; ]] $[[0]] | Disadvantage,Task Roll at Disadvantage [[ 1t[[[ {[[2d20kl1]],-1} &gt; [[@{target_number}]] ]]]&nbsp; ]] $[[0]] } }} Obviously, there is another syntax issue, but I'm not sure where or why. It is really confusing why a string of macro code works alone, but not when inserted into a larger macro.
Roll queries and Group rolls don't play well together since they share some of the same syntax such as commas and braces. As such they have to be replaced by HTML entities. More info on the wiki . But it's generally better to avoid having to do so by only putting the bare minimum inside the roll query. As such your query can be simplified as ?{Task Type| Normal,Normal Task Roll [[ 1t[[[ {[[1d20| Advantage,Task Roll with Advantage [[ 1t[[[ {[[2d20kh1| Disadvantage,Task Roll at Disadvantage [[ 1t[[[ {[[2d20kl1}]],-1}&gt;[[@{target_number}]] ]]] ]] $[[0]] This puts the offending syntax outside the roll query where it shouldn't cause a problem.
Thanks! I read that page. A couple of times. I seemed to have missed the part about Roll Queries and Group Rolls being separate entities. I'll keep that in mind going forward.&nbsp;