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

Using a single query to output two values?

July 16 (1 month ago)

Edited July 16 (1 month ago)

I'm working on some macros for my Fey Wanderer Ranger. I have queries set up in the damage roll to ask if its a crit (because she is swinging with advantage so often from Vex, crits are fairly common) and which additional damages apply. It works perfectly how I have it set up, but I would love to be able to indicate that its rolling crit damage by changing the "TOTAL DAMAGE" at the bottom to "CRITICAL DAMAGE" without adding an extra prompt. Is there a way to do this without API calls? I think it could maybe be done with nested queries but I can't wrap my head around the logic.

My macro:

&{template:default} [[ [[ [[1*?{Critical|No,1|Yes,2}]]d8+4+1]] + [[ [[?{Hunter's Mark|Yes,1|No,0}*?{Critical}]]d6]] + [[ [[?{Dreadful Strikes|Yes,1|No,0}*?{Critical}]]d4]] ]]  {{name=**Rapier +1** Damage}} {{**Weapon**=$[[1]] *Piercing*}} {{Hunter's Mark=$[[3]] *Force*}} {{Dreadful Strikes=$[[5]] *Psychic*}} {{**TOTAL DAMAGE**=$[[6]] }}

Output (after clicking the HIT button):

If there's not a way to do this then I'll simply add a "CRIT" button next to the "HIT" one and call it done.

July 16 (1 month ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

possible? yes. It is however a PITA to nest roll template fields in roll queries.

What character sheet are you using for 5e? If I'm understanding what you are wanting to do, I think that putting this in the inputs of the attack on the 5e 2014 sheet would probably get you pretty close to what you want. Although, it would not have every thing split out separately the way you do, instead it would be visible in the hover of the total damage, and then the critical damage would be a separate number.

Scott C. said:

possible? yes. It is however a PITA to nest roll template fields in roll queries.

What character sheet are you using for 5e? If I'm understanding what you are wanting to do, I think that putting this in the inputs of the attack on the 5e 2014 sheet would probably get you pretty close to what you want. Although, it would not have every thing split out separately the way you do, instead it would be visible in the hover of the total damage, and then the critical damage would be a separate number.

We're just using DDB for 5e 2024 character sheets connected with Beyond20 so the macros are mainly in place so I don't have to click over for my most common actions. I have a 2014 character sheet partly statted out in Roll20 to make a few things simpler, but I don't think any of us (DM included) own the 2024 handbook in Roll20.

So single queries cannot output 2 different values however a single value can be used in different ways.

&{template:default} [[ [[ [[1*?{Critical|No,1{{**TOTAL|Yes,2{{**CRITICAL}]]d8+4+1]] + [[ [[?{Hunter's Mark|Yes,1|No,0}*?{Critical}]]d6]] + [[ [[?{Dreadful Strikes|Yes,1|No,0}*?{Critical}]]d4]] ]]  {{name=**Rapier +1** Damage}} {{**Weapon**=$[[1]] *Piercing*}} {{Hunter's Mark=$[[3]] *Force*}} {{Dreadful Strikes=$[[5]] *Psychic*}} ?{Critical} DAMAGE**=$[[6]] }}

By changing the query to include the start of the damage field the same query can change TOTAL into CRITICAL but when used inside of a nested roll that extra text disappears (as a roll comment) and the numbers are unaffected. It also doesn't require any of the problematic guff from putting an entire template inside of a query

July 16 (1 month ago)

Edited July 17 (1 month ago)


RainbowEncoder said:

So single queries cannot output 2 different values however a single value can be used in different ways.

&{template:default} [[ [[ [[1*?{Critical|No,1{{**TOTAL|Yes,2{{**CRITICAL}]]d8+4+1]] + [[ [[?{Hunter's Mark|Yes,1|No,0}*?{Critical}]]d6]] + [[ [[?{Dreadful Strikes|Yes,1|No,0}*?{Critical}]]d4]] ]]  {{name=**Rapier +1** Damage}} {{**Weapon**=$[[1]] *Piercing*}} {{Hunter's Mark=$[[3]] *Force*}} {{Dreadful Strikes=$[[5]] *Psychic*}} ?{Critical} DAMAGE**=$[[6]] }}

By changing the query to include the start of the damage field the same query can change TOTAL into CRITICAL but when used inside of a nested roll that extra text disappears (as a roll comment) and the numbers are unaffected. It also doesn't require any of the problematic guff from putting an entire template inside of a query

You are a genius! Thank you so much, that works perfectly!