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 a Query have name and a value in a Abilities Macro. Other than choosing either a name, or a value, can you choose a name and value ?

Can a Query have name and a value in a Abilities Macro. Other than choosing either a name, or a value, can you choose a name and value and have it display both the name and the value ?   I am trying to add a macro to a character that will offer 3 types of attacks from the attributes modifiers of a character to select from "+ [[?{Attack Type|Fighting,@{Fighting}|Shooting-Ranged Weapons,@{Shooting-Ranged Weapons}|Strength,@{Strength}}]] " then ask for any special skills or item bonus " + [[?{Special Skills and Item Bonus if Any|+0,0|+1,1 | +2, 2 | +3, 3 | +4, 4| +5, 5}]] "  then show the itemized results with : the d20 roll result, the amount of the added attribute from the attribute list and which attribute was added ,   the amount added for Special Skills and Item Bonus if Any ,  and the total result,  ''{{ Rolls a D20 $[[0]]}} {{ + $[[1]] Skill Points}} {{ + $[[2]] Special Item or skill }} {{==$[[3]] **TOTAL** }}'' Then I want it to show which attribute and modifier   was added. This is the part I can't get cause it will only show the modifier from the attribute and not which Attribute was selected     '' {{for Attack with+ $[[1]] Skill}} '' What I have so far in its entirety -  :&{template:default} [[ [[1d20]] + [[?{Attack Type|Fighting,@{Fighting}|Shooting-Ranged Weapons,@{Shooting-Ranged Weapons}|Strength,@{Strength}}]] + [[?{Special Skills or Item Bonus|+0,0|+1,1 | +2, 2 | +3, 3 | +4, 4| +5, 5}]] ]] {{name= Attack Roll }} {{ Rolls a D20 $[[0]]}} {{ + $[[1]] Skill Points}} {{ + $[[2]] Special Item or skill }} {{==$[[3]] **TOTAL** }} {{for Attack with+ $[[1]] skill}} 
1615454559
Ziechael
Forum Champion
Sheet Author
API Scripter
Something like this should do what you want... it changes the order of the queries and therefore the id of the rolls but allows for a dynamic table name to define the skill without having to add additional overhead like hovering over results to see the skill used or fully nesting the entire template as the result of each query option (happy to give examples of that madness if needed though): &{template:default} [[ [[1d20]] + [[?{Special Skills or Item Bonus|+0,0|+1,1 | +2, 2 | +3, 3 | +4, 4| +5, 5}]] + [[?{Attack Type|Fighting,@{Fighting}]] ]] {{name= Fighting Attack Roll|Shooting-Ranged Weapons,@{Shooting-Ranged Weapons}]] ]] {{name= Ranged Attack Roll|Strength,@{Strength}]] ]] {{name= Strength Attack Roll} }} {{ Rolls a D20 $[[0]]}} {{ + $[[2]] Skill Points}} {{ + $[[1]] Special Item or skill }} {{==$[[3]] **TOTAL** }}
Thank you for your reply Ziechael, You Da Man (or preferred gender pronoun)!!  The outcome worked perfect but I am not sure why,  and yes the questions it asked were out of order which I can live with but is not preferable . Is there a way to put the ''   [[?{Special Skills or Item Bonus|+0,0|+1,1 | +2, 2 | +3, 3 | +4, 4| +5, 5}]] " after  asking what type of attack it is without using an api , if not that is ok. For my learning and understanding; When you say "dynamic table" is that part of the " &{template:default} " programming 
1615544604

Edited 1615544674
Ziechael
Forum Champion
Sheet Author
API Scripter
The simple fact is that you cannot have a single query output two different results so to get text as well as numbers you need to nest everything that is needing to be different within the query. In your example, since you are utilising the inline id trick to break down the overall calculation and  your queries are part of that I needed to finish the inline roll with the query that contains the differences... which also allowed me to nest the {{name= part of the template in there for the dynamic naming part... in essence we now have: <template> <inline roll -- query 1 (bonus) -- query 2 (attribute AND template name field)> <rest of template> To reorder the queries you would have to nest the bonus query within the attack type one like this: &{template:default} [[ [[1d20]] + [[?{Attack Type|Fighting,@{Fighting} ]] + [[?{Special Skills or Item Bonus|+0,0|+1,1|+2,2|+3,3|+4,4|+5,5}]] ]] {{name= Fighting Attack Roll|Shooting-Ranged Weapons,@{Shooting-Ranged Weapons} ]] + [[?{Special Skills or Item Bonus|+0,0|+1,1|+2,2|+3,3|+4,4|+5,5}]] ]] {{name= Ranged Attack Roll|Strength,@{Strength} ]] + [[?{Special Skills or Item Bonus|+0,0|+1,1|+2,2|+3,3|+4,4|+5,5}]] ]] {{name= Strength Attack Roll} }} {{ Rolls a D20 $[[0]]}} {{ + $[[1]] Skill Points}} {{ + $[[2]] Special Item or skill }} {{==$[[3]] **TOTAL** }} this uses a html nested query within the first query to put the bonus after the type query but requires a disconcerting amount of repetition (for my OCD anyway) and would require careful handling should you ever use it as part of the collections macro since they don't play nicely with html entities, as a character ability however it will be fine. By 'dynamic' table I'm really meaning conditional I suppose lol... my terminology and lingo changes depending on the time of day, phase of the moon and how tired I might be at the time of posting!
Thank you Z, You&nbsp; are always welcome in one of my games if i ever get my roll20 fully set up, I animated one of the games i played with my friends and you can see it here. if you want to see what my DMing is like <a href="https://youtube.com/playlist?list=PLW8bCYO0w4Tl5MrVcV0l7UREKx05lQXC-" rel="nofollow">https://youtube.com/playlist?list=PLW8bCYO0w4Tl5MrVcV0l7UREKx05lQXC-</a>&nbsp;
1615629623
Ziechael
Forum Champion
Sheet Author
API Scripter
Thanks for the kind words, I'll have to check out your playlist :D Happy rolling!