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

Can put the asked for variable into a field and use it again, but I'm not sure how to extract the value for use in a comparison die roll

Can put the asked for variable into a field and use it again, but I'm not sure how to extract the value for use in a comparison die roll My string is below &{template:default} {{name=BARKA makes a ?{What Ability?|STR|DEX|CON|INT|WIS|CHA} Check}} {{A roll of ?{What Ability?} or less is successful}}
Try one of these: &{template:default} {{name=BARKA makes a ?{What Ability?|STR, [STR] (@{STR})|DEX, [DEX] (@{DEX})|CON, [CON] (@{CON})|INT, [INT] (@{INT})|WIS, [WIS] (@{WIS})|CHA, [CHA] (@{CHA})} Check }} {{A roll of ?{What Ability?} or less is successful }} &{template:default} {{name=BARKA makes a ?{What Ability?|STR, [STR] (@{STR})|DEX, [DEX] (@{DEX})|CON, [CON] (@{CON})|INT, [INT] (@{INT})|WIS, [WIS] (@{WIS})|CHA, [CHA] (@{CHA})} Check }} {{A roll of [[ ?{What Ability?} + 0d0 ]] or less is successful }}
The above string works but I misstated what I needed. I need What Ability to store a NUMBER. Then I would /roll 1d20<[?{What Ability}+1] Then comparison would indicate 0 or 1 successes I hope I'm saying this right
1488252699
Lithl
Pro
Sheet Author
API Scripter
/roll 1d20<[[?{What Ability} + 1]] Silvyre's example has the value of the query as an attribute (wrapped in parentheses so that negative numbers won't break anything) and a roll label (which is ignored by the dice engine, but you can see when hovering over the inline roll)
1488253355

Edited 1488253383
The string asks TWICE for ability: once with a dropdown bar for text, another time for a number. I just want ONE query: the dropdown bar for the Ability and then then NUMERICAL VALUE of the Ability as an Attribute to be used in a 1d20<[[?{What Ability]] comparison I think I worded it right this time THANK FOR ALL YOUR PATIENCE!
1488253483

Edited 1488253512
It's as Brian said: &{template:default} {{name=BARKA makes a ?{What Ability?|STR, [STR] (@{STR})|DEX, [DEX] (@{DEX})|CON, [CON] (@{CON})|INT, [INT] (@{INT})|WIS, [WIS] (@{WIS})|CHA, [CHA] (@{CHA})} Check }} {{[[ 1d20<[[?{What Ability?} + 0d0]] ]] will equal 1 if 1d20 is less than **or equal to** ?{What Ability?} }}
1488253688
Lithl
Pro
Sheet Author
API Scripter
If you're getting more than one popup, it's because the label is not the same. ?{What Ability?} is a different query from ?{What Ability}.
I fiddled around with it. I'm trying to have 1st line read STR Check, not [STR] 18 Check. Try as I might, I just can't do this. I feel like an idiot.  I tried removing the [] but now it won't do anything if I do that. Where am I going wrong with the string below? Everything else is correct; just the formatting is off &{template:default} {{name=BARKA makes a ?{What Ability?|STR, [STR] (@{STR})|DEX, [DEX] (@{DEX})|CON, [CON] (@{CON})|INT, [INT] (@{INT})|WIS, [WIS] (@{WIS})|CHA, [CHA] (@{CHA})} Check}} /roll 1d20<[[?{What Ability?} + 0d0]]
We're delving into advanced macro territory: &{template:default} {{name=BARKA makes a ?{What Ability?| STR, STR Check }} /r 1d20<@{STR} | DEX, DEX Check }} /r 1d20<@{DEX} | CON, CON Check }} /r 1d20<@{CON} | INT, INT Check }} /r 1d20<@{INT} | WIS, WIS Check }} /r 1d20<@{WIS} | CHA, CHA Check }} /r 1d20<@{CHA} } Check out  Advanced Usage for Roll Queries for explanation of why HTML entities are needed within this particular macro.
1488296240

Edited 1488296291
Wow! Thanks for clearing that up and helping me so much! I'm new at this so I don't understand why the 2nd } in a row is needed. (I tried writing 125 but the engine switched it on me) I would've figured only one After the output line "Barka makes a STR check" is it possible to write "A roll of @STR will be successful" BEFORE the roll of 1d20<@{STR}
Andy K. said: I'm new at this so I don't understand why the 2nd } in a row is needed. Those two entitized }} 's close the {{name= }} field. Andy K. said: is it possible to write "A roll of @STR will be successful" BEFORE the roll of 1d20<@{STR} Yup: &{template:default} {{name=BARKA makes a ?{What Ability?| STR, STR Check }} {{A roll of @{STR} will be successful}} /r 1d20<@{STR} | DEX, DEX Check }} {{A roll of @{DEX} will be successful}} /r 1d20<@{DEX} | CON, CON Check }} {{A roll of @{CON} will be successful}} /r 1d20<@{CON} | INT, INT Check }} {{A roll of @{INT} will be successful}} /r 1d20<@{INT} | WIS, WIS Check }} {{A roll of @{WIS} will be successful}} /r 1d20<@{WIS} | CHA, CHA Check }} {{A roll of @{CHA} will be successful}} /r 1d20<@{CHA} }
Nice. Quick question, how would you add a modifier to the above. Instead of a straight d20, something along the lines of  STR, STR Check }} {{A roll of @{STR} will be successful}} [[1d20+?{Misc. Modifier|0}]]<@{STR} but still working in the context of the above macro which this won't do.
1488865798

Edited 1488866550
Al H. said: Quick question, how would you add a modifier to the above. The most straightfoward way is to add the Roll Query to every dropdown field: &{template:default} {{name=BARKA makes a ?{Ability|    STR, STR Check }} {{A roll of @{STR} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{STR} |    DEX, DEX Check }} {{A roll of @{DEX} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{DEX} |    CON, CON Check }} {{A roll of @{CON} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{CON} |    INT, INT Check }} {{A roll of @{INT} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{INT} |    WIS, WIS Check }} {{A roll of @{WIS} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{WIS} |    CHA, CHA Check }} {{A roll of @{CHA} will be successful}}    [[ { 1d20 + ?{Modifiers|0} }<@{CHA} } Alternatively, { 1d20 + ?{Q} }<[[@{A}]] can be rewritten as 1d20<[[@{A} - ?{Q}]], which can save the pain of using more HTML entities: &{template:default} {{name=BARKA makes a ?{Ability|    STR, STR Check }} {{A roll of @{STR} will be successful}}    [[ 1d20<[[@{STR} |    DEX, DEX Check }} {{A roll of @{DEX} will be successful}}    [[ 1d20<[[@{DEX} |    CON, CON Check }} {{A roll of @{CON} will be successful}}    [[ 1d20<[[@{CON} |    INT, INT Check }} {{A roll of @{INT} will be successful}}    [[ 1d20<[[@{INT} |    WIS, WIS Check }} {{A roll of @{WIS} will be successful}}    [[ 1d20<[[@{WIS} |    CHA, CHA Check }} {{A roll of @{CHA} will be successful}}    [[ 1d20<[[@{CHA} } - ?{Modifiers|0}]] ]] And, in case you're interested, a trick that I did not mention earlier can be used to further minimize the amount of HTML entities used: &{template:default} {{name=BARKA makes a ?{Ability|    STR, STR Check }} ] @{STR} |    DEX, DEX Check }} ] @{DEX} |    CON, CON Check }} ] @{CON} |    INT, INT Check }} ] @{INT} |    WIS, WIS Check }} ] @{WIS} |    CHA, CHA Check }} ] @{CHA} } [[ { 1d20 + ?{Modifiers|0} }<[[ 0d0 + [ ?{Ability} ]] ]]
1488894810

Edited 1488912620
Thank you very much. That last example is exactly what I was trying for... just not able to get. I bow at the feet of the master. :-) Time to re-read the wiki.
Best of luck!
Is there a way of throwing in a Crit success/fumble into that last part? This is what I have.  {{Result=[[ [[ { 1d20 + ?{Modifiers|0} }]]cs<[[ 0d0 + [ ?{Ability} ]]cf>[[ 0d0 + [?{Ability} ]] ]] }} It outputs the dice roll and resolves the values for the ability just fine, but it doesn't highlight the result in green/red depending on the result. I know I'm missing something basic. Your help [and patience] are greatly appreciated.
1488942926

Edited 1488943086
{ 1d20 + ?{Modifiers|0} } is a Grouped Roll , and those cannot be modified by Critical Success and Fumble Points . Instead, directly modify the 1d20 like so: {{Result=[[ 1d20cs<[[0d0 + [ ?{Ability} - (?{Modifiers|0})]]cf>[[0d0 + [ ?{Ability} - (?{Modifiers})]] + ?{Modifiers} ]]}}
Thanks again.