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 .
×

How can I make template macros sum the results of different queries?

1619122875

Edited 1619124823
How can I make the following add-up and have a total result at the end of the template? &{template:default} {{name= **Action**}} {{Attempt=(?{Action?|Normal,[[2d6]]|Advantage,[[3d6kh2]]|Disadvantage,[[3d6kl2]]})}} + {{Training=(?{Training?|Untrained,[[0]]|Beginner,[[1]]|Aspirant,[[2]]|Professional,[[3]]|Expert,[[4]]|Master,[[5]]})}} + {{Aspect=(?{Aspect?|None,[[0]]|Aspect1,[[1]]|Aspect2,[[2]]|Aspect3,[[3]]})}} I have come this far, but this is about the extension of my knowledge of macros. I'm at a loss on how I'd be able to add the individual results of each of these while they're so separated? Alternatively, how would I set up a macro where I could make all of these calculations and have only the result pop clearly in the chat as a template? I appreciate any assistance.
1619166883

Edited 1619166934
Ziechael
Forum Champion
Sheet Author
API Scripter
Here you go, try this out for size: &{template:default} {{name= **Action**}} [[ [[?{Action?|Normal,2d6|Advantage,3d6kh2|Disadvantage,3d6kl2}]] + [[?{Training?|Untrained,0|Beginner,1|Aspirant,2|Professional,3|Expert,4|Master,5}]] + [[?{Aspect?|None,0|Aspect1,1|Aspect2,2|Aspect3,3}]] ]] {{Attempt=($[[0]])}} {{Training=($[[1]])}} {{Aspect=($[[2]])}} {{Total=($[[3]])}} It uses the trick outlined here for reference.
Ziechael said: Here you go, try this out for size: &{template:default} {{name= **Action**}} [[ [[?{Action?|Normal,2d6|Advantage,3d6kh2|Disadvantage,3d6kl2}]] + [[?{Training?|Untrained,0|Beginner,1|Aspirant,2|Professional,3|Expert,4|Master,5}]] + [[?{Aspect?|None,0|Aspect1,1|Aspect2,2|Aspect3,3}]] ]] {{Attempt=($[[0]])}} {{Training=($[[1]])}} {{Aspect=($[[2]])}} {{Total=($[[3]])}} It uses the trick outlined here for reference. Thank you so very much. You really are a champion. I'm also going to refer to this trick in the future. All the love!