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

HTML Entities & Roll Queries in Roll Buttons

1460913668

Edited 1461016674
Carl T
Sheet Author
Hi. I've modeled a nested roll query with the default roll template in the chat window and have it working. It involves using HTML entities to do escapes as described in the Macros wiki. The problem is when I place the working query in the value attribute of a roll button the escaping seems to revert to an unescaped state (at least as observed in the chat window) thereby causing errors. Here's my code: <button type="roll" class="sheet-roll-button" name="roll_bodyroll" value="&{template:default} {{name=Body}} ?{Dice Pool Modifier|0} + ?{Action | Roll Dice, {{Successes=[[(@{body}*2+?{Dice Pool Modifier})d2>2]] }}  {{Modifier=?{Dice Pool Modifier} }}|Take the Average, {{Average Successes=[[((@{body}*2+?{Dice Pool Modifier})%2)d2>2+[[floor((@{body}*2+?{Dice Pool Modifier})/2)]] ]] }} {{Modifier=?{Dice Pool Modifier} }} {{Body (x2)=[[@{body}*2]] }} }"></button> Is what I'm proposing above possible? There's a passage in the Advanced Usage for Roll Queries about having to save these to abilities that I don't quite get, but am wondering if it affects my solution above. Edit: It looks like the editor here also unescapes the escape codes...argh...
Carl T said: There's a passage in the Advanced Usage for Roll Queries about having to save these to abilities that I don't quite get Thanks, I just made some changes/expansion around that point within that section: At this time, reopening a Macro saved under the My Settings tab of the Sidebar causes HTML entities within to be reverted; if the Macro is then saved, so are those reversions. This behaviour is not present within Abilities .
1461016587
Carl T
Sheet Author
I'm still not sure what to do with this information. Is this a bug that the code in the OP can be typed into the chat window with escapes and it works, but not as part of the button value? AFAIK there's no way to create abilities as part of a character sheet.
1461021097

Edited 1461021122
Shot in the dark: within the HTML entities, try replacing & with & i.e. } would become }
1461070635
Carl T
Sheet Author
Using the & escape code creates some brutally ugly code but it does seem to work!
Haha, glad to hear it!