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

Referencing Ability from Query

1511024335

Edited 1511024582
The goal is to have a Yes/No prompt for sneak damage, that then calls an Ability. This way, sneak damage would only need to be updated in one location (based on feats, equipment, et cetera.) Any help in resolving this would be greatly appreciated. Sample code for one weapon's damage is below: {1d4 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec],1d1}k1 + ?{Sneak Attk|No,0|Yes,%&#123SneakDMG&#125}[Sneak] + ?{Scarlet Einhander|Yes,1d6|No,0}[Stance] Code for the sneak damage ability (this code works properly when incorporated into the damage roll): [[[[floor((@{Hadan|level}-4)/3)+2]]d6]] + @{Hadan|level} I've tried multiple different formats (%,#,~ (just in case I was using the wrong one), with and without the character name, backwards, upside down) and always end up with the ability as text in the output details (hovering over the result).
I believe, due to the order of operations for roll20, abilities do not need to be encoded. Like attributes, they are processed before queries. Secondly I believe that you are missing an extra [[]] around the sneak attack damage so the label is attached to the combined number and not just the level for the character. Try this {1d4 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec],1d1}k1 + [[?{Sneak Attk|No,0|Yes,%{SneakDMG}}]][Sneak] + ?{Scarlet Einhander|Yes,1d6|No,0}[Stance]
Awesome! Thank you Kyle! Was giving an unidentified substring error, but adding the character name fixed that. In the event I want to replicate this in the future, the key difference was that the HTML code was NOT needed for the ability? Otherwise it was okay? (Am aware that the double brackets were needed to fix the Sneak tag... presuming I should be able to at least figure THAT out in the future heh.)
Yes, HTML code is not needed to call abilities or attributes. However, the code within the ability/attribute may need to be HTML encoded. This is most common example when the ability/attribute uses a roll template or a query itself.