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

DND 5e Adding Proficiency Query and Modifier query to Ability Score Check macro (Dropdown in Dropdown)

1573680487

Edited 1573680504
I have a macro that works for querying ability checks, except for character name output.  I often use or allow checks of a stat that is not paired with a usual skill, and I want to add to the end another drop down for a query to see if is a person is proficient or has expertise: +?{Proficient|None, 0|Skilled, [[@{PB}]] |Expertise, [[@{PB}]]*2 } Then I want a text box that is also a query. +?{Additional Modifier|0} I have tried to add it to the r1 line but it is not working.   I think it is because of the { [ ] } wrapping is getting jumbled in my head. My code is as follows: @{selected|wtype}&{template:simple} @{selected|rtype}?{Stat |Strength,+[[@{selected|strength_mod}]][STR] ]]}} {{rname=^{strength-u}}} {{mod=[[ [[@{selected|strength_mod}]][STR] ]]}} {{r1=[[@{selected|d20}+[[@{selected|strength_mod}]][STR] ]] |Dexterity,+[[@{selected|dexterity_mod}]][DEX] ]]}} {{rname=^{dexterity-u}}} {{mod=[[ [[@{selected|dexterity_mod}]][DEX] ]]}} {{r1=[[@{selected|d20}+[[@{selected|dexterity_mod}]][DEX] ]] |Constitution,+[[@{selected|constitution_mod}]][CON] ]]}} {{rname=^{constitution-u}}} {{mod=[[ [[@{selected|constitution_mod}]][CON] ]]}} {{r1=[[@{selected|d20}+[[@{selected|constitution_mod}]][CON] ]] |Intelligence,+[[@{selected|intelligence_mod}]][INT] ]]}} {{rname=^{intelligence-u}}} {{mod=[[ [[@{selected|intelligence_mod}]][INT] ]]}} {{r1=[[@{selected|d20}+[[@{selected|intelligence_mod}]][INT] ]] |Wisdom,+[[@{selected|wisdom_mod}]][WIS] ]]}} {{rname=^{wisdom-u}}} {{mod=[[ [[@{selected|wisdom_mod}]][WIS] ]]}} {{r1=[[@{selected|d20}+[[@{selected|wisdom_mod}]][WIS] ]] |Charisma,+[[@{selected|charisma_mod}]][CHA] ]]}} {{rname=^{charisma-u}}} {{mod=[[ [[@{selected|charisma_mod}]][CHA] ]]}} {{r1=[[@{selected|d20}+[[@{selected|charisma_mod}]][CHA] ]] }}} @{selected|global_skill_mod} @{selected|charname_output}
1573680843
GiGs
Pro
Sheet Author
API Scripter
It's most likely because of this:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> When nesting macros, any } will be interpreted as the end of the query, causing issues, requiring you to replace the nested } characters with the html substitution. The same occurs with commas and pipes "|".&nbsp;
Thanks GiGis.&nbsp; I was wondering about that.&nbsp; &nbsp;I tried to fix it with those but got no closer to a solution.&nbsp; In fact, it stopped working altogether. I was trying to add it to each of the dropdown ability scores, like this Strength example: |Strength,+[[@{selected|strength_mod}]][STR] ]]}} {{rname=^{strength-u}}} {{mod=[[ [[@{selected|strength_mod}]][STR] ]]}} {{r1=[[@{selected|d20}+[[@{selected|strength_mod} +?{Proficient|None, 0|Skilled, [[@{PB}]] |Expertise, [[@{PB}]]*2 &amp;#125 +?{Additional Modifier|0 &amp;#125 ]][STR] ]] Can you steer me in the right direction to getting this to work?
1573683356

Edited 1573683435
GiGs
Pro
Sheet Author
API Scripter
I prefer to avoid using nested macros where roll templates are concerned, I use Chat Menus because they are much simpler (no html nonsense to deal with). But as a clue, on this line |Strength,+[[@{selected|strength_mod}]][STR] ]]}} {{rname=^{strength-u}}} {{mod=[[ [[@{selected|strength_mod}]][STR] ]]}} {{r1=[[@{selected|d20}+[[@{selected|strength_mod}]][STR] ]] i see a LOT of characters that would need to be altered. After the comma, every } character would need to be changed with its entity, except for ones at the end of&nbsp;@{selected|d20} and&nbsp;@{selected|strength_mod}. I dont know if the one at the end of&nbsp;^{strength-u} needs changing.&nbsp; As a Pro user you might look into a script to generate menus for you, like my Universal Chat Menus , or Scott's Menu Maker . Though if you are making custom macros, they wont be much help.
1573683542
GiGs
Pro
Sheet Author
API Scripter
For your addition,&nbsp; ?{Proficient|None, 0|Skilled, [[@{PB}]] |Expertise, [[@{PB}]]*2&nbsp; &amp;#125 +?{Additional Modifier|0 &amp;#125 ]][STR] ]] if those are inside a row of the first query, you'll also need to change each | (not inside stat calls) and commas. And some of them you might have to nest twice (see the last section from the wiki i linked). This gets extremely complex.
So, I went right back to the wiki, and came up with a script that works, no character mismatch errors, and does everything mechanically i want [[?{Ability Check?|Strength, @{selected|strength_mod}|Dexterity, @{selected|dexterity_mod}|Constitution, @{selected|constitution_mod}|Intelligence, @{selected|intelligence_mod}|Wisdom, @{selected|wisdom_mod}|Charisma, 1@{selected|charisma_mod}} + ?{Advantage?|None, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1} + ?{Proficiency?|None, 0|Skilled, @{selected|pb}|Expertise, @{selected|pb} + @{selected|pb}} + ?{Additional Modifier?|0}&nbsp; ]]
1573703862
GiGs
Pro
Sheet Author
API Scripter
Thats great. Always try to avoid nesting, if you can. It's a minefield :)