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

Dropdown with number, dice, and tables as answers

1438103149
DK Heinrich
Marketplace Creator
Sheet Author
ok, here is what I want to do followed by what I have done that is not working. all of this uses !powercards and in the long run the answer will be used as a conditional but I nuked all that for now. Query if a player has a roll modifier (3 answers) -- [[ ?{Roll Modifier|None, 0|Boon, 'x'|Bane, 'y'} ]] if 0, all I want is 0 to kick out as my answer, no more queries. if 'x', Query how many d6 to roll (default 1) and keep highest one -- x = ?{Number of Boons|1}d6kh1  if 'y', Ask how many table rolls to roll (default 1) and keep lowest one -- y = ?{Number of Banes|1}t[BaneDice]kl1  so to insert the 'x' and 'y' into the original query, adding in { } (per previous thread) I get this --  [[ ?{Roll Modifier|None, 0|Boon, {?{Number of Boons|1}d6}kh1|Bane, {?{Number of Banes|1}t[BaneDice]}kl1} ]]    results: Main query asks 'None, Boon, 1' If select None - asks 'Number of Banes' If select Boon - asks 'Number of Boonsd6' If select 1 - asks 'Number of Banes' What did I miss?
1438104712
The Aaron
Roll20 Production Team
API Scripter
I don't think you can nest Roll Queries like that...? I'll have to test. 
1438104793

Edited 1438105094
DK Heinrich
Marketplace Creator
Sheet Author
well if not then at least I am not just going crazy :) just noticed I did not mention... the RT [BaneDice] is basically a negative d6  -1 thru -6 all weighted at 1 each. this, in theory, allows me to add a negative d6 (net: subtract a d6) if bane is chosen inside the same marco that adds a d6 if boon is chosen, without having to have two sets of output... basically if this can work it cuts my macro size by about 40%
1438105072

Edited 1438105133
Diana P
Pro
Sheet Author
It's a problem with the roll query breaking on commas, closing braces, and the vertical bar. (There is a bug report in on this; Riley says he'll look at it for the next content patch.:&nbsp; <a href="https://app.roll20.net/forum/post/2220058/new-roll" rel="nofollow">https://app.roll20.net/forum/post/2220058/new-roll</a>... If you replace those with html entities, you can get it to work. [[ ?{Roll Modifier|None, 0|Boon, {?{Number of Boons& #124;1& #125;d6& #125;kh1 |Bane, {?{Number of Banes& #124;1& #125;t[BaneDice]& #125;kl1 }&nbsp; ]] here I've done so (and it worked best I can tell without building a bane dice table :) to get this to work, you will have to remove the spaces between the & and #1 in the html entities.&nbsp; You also cannot save it as a general macro; it MUST be saved as a character sheet Ability to work (the general macros convert the html entities back to the character, breaking it.) Hope that helps.
1438105165

Edited 1438105447
DK Heinrich
Marketplace Creator
Sheet Author
ok, that was an option I thought of but was swayed away from it --- probably because I gave incomplete information in another thread&nbsp; Thanks - trying that now EDIT: Perfection! ... now to plug in the !powercard info and set up the conditionals to see if I can re-break it :)
1438105414
Diana P
Pro
Sheet Author
:)&nbsp; I have one for weapon skills with nested queries I'm working on for my character in a campaign and have yet to get it to work properly, but then it was quite complicated to start with so I may still be missing more commas, closing braces, and vertical bars.&nbsp; They can be pesky to find!
1438105852

Edited 1438106152
DK Heinrich
Marketplace Creator
Sheet Author
if I want to call out my answer again later in the output - I thought I read that you can just use the initial query... but what is the format? &nbsp;?{Roll Modifier} in my case? Edit: testing as I typed it looks to be working. Edit2: wow this is rocking, cut 7 lines of 22 on my test macro... (not really the cultists attack, but he perfectly average and makes best test subject).
1438106191

Edited 1438106248
Diana P
Pro
Sheet Author
It should be. I tend to use copy/paste so I don't bother taking out the default value for small queries but obviously you don't want to do that in this case; it's too long! Edit:&nbsp;&nbsp; :)&nbsp; Looking good!
1438112333

Edited 1438113365
Diana P said: It's a problem with the roll query breaking on commas, closing braces, and the vertical bar. (There is a bug report in on this; Riley says he'll look at it for the next content patch.:&nbsp; <a href="https://app.roll20.net/forum/post/2220058/new-roll" rel="nofollow">https://app.roll20.net/forum/post/2220058/new-roll</a>... If you replace those with html entities, you can get it to work. [[ ?{Roll Modifier|None, 0|Boon, {?{Number of Boons& #124;1& #125;d6& #125;kh1 |Bane, {?{Number of Banes& #124;1& #125;t[BaneDice]& #125;kl1 }&nbsp; ]] here I've done so (and it worked best I can tell without building a bane dice table :) to get this to work, you will have to remove the spaces between the & and #1 in the html entities.&nbsp; You also cannot save it as a general macro; it MUST be saved as a character sheet Ability to work ( the general macros convert the html entities back to the character, breaking it. ) Hope that helps. Just FYI - I found out that this is not exactly true. You can in fact create a nicely multi-layer nested macros with html entities and have them as General Macro, but you can never go back to edit that macro (not even once), because like you said, it converts the entities back and breaks the macro. What you want to do is create your html-entities infused macros in some text editor (wordpad will do the job nicely) then copy and paste into general macro edit window, then click save and try it - you'll see that it works. Until the moment you open the edit macro screen and it breaks. :-) Hope this helps. EDIT: So just to be clear you can make changes in the macro, but each time you have to make them in wordpad and copy entire thing over to the macro window, save and enjoy! EDIT2: Going back into edit screen just to look at the macro and clicking Cancel instead of Save does NOT break the macro.
1438115355

Edited 1438115460
The Aaron
Roll20 Production Team
API Scripter
Diana P said: to get this to work, you will have to remove the spaces between the & and #1 in the html entities. &nbsp; Just an FYI, on the forum, you can enter & as &amp; to prevent it from getting parsed out: ?{Number of Boons&amp;amp;#124;1&amp;amp;#125;d6&amp;amp;#125;kh1 |Bane, {?{Number of Banes&amp;amp;#124;1&amp;amp;#125;t[BaneDice]&amp;amp;#125;kl1 Which then gets you: ?{Number of Boons&amp;#124;1&amp;#125;d6&amp;#125;kh1 |Bane, {?{Number of Banes&amp;#124;1&amp;#125;t[BaneDice]&amp;#125;kl1
1438117054
Diana P
Pro
Sheet Author
Html entities within html entities???&nbsp; It's html entities all the way down. Also, I didn't think of that. Thanks :)
1438118076
The Aaron
Pro
API Scripter
Diana P said: Html entities within html entities???&nbsp; It's html entities all the way down. Also, I didn't think of that. Thanks :) You ain't kiddin'. I actually had to type that as: &amp;amp;amp; ...which I just typed as: &amp;amp;amp;amp; ...which I just typed as: &amp;amp;amp;amp;amp; ...which I just typed... =D
1438118349

Edited 1438118423
Silvyre
Forum Champion
Using &amp;amp; for & to nest entities is much cleaner than what I've been using up to this point (&amp;#35; for #). Thank you for the tip, Scriptomancer!
1438120957
The Aaron
Roll20 Production Team
API Scripter
No problem! &nbsp;I documented this and some other things in the wiki a while back:&nbsp; <a href="https://wiki.roll20.net/API:Chat#Entering_API_Butt" rel="nofollow">https://wiki.roll20.net/API:Chat#Entering_API_Butt</a>...