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

Embedding input values into macro buttons

I'm running an EverQuest tabletop game and using default character sheets and building all my macros from scratch.  Currently I've read enough posts to figure out how to use variable Power Attack (subtract an input from BAB to add the same value to damage) as well as incorporate flanking and charging into a single attack button as follows: Warhammer attack: [[1d20+@{BAB}+@{Str mod}+1+1-?{Power Attack value|0}+?{Flanking?|Yes,2|No,0}+?{Charge?|Yes,2|No,0}]] Damage: [[1d8+@{Str mod}+1+?{Power Attack value}+?{Charging}]] Now what I'm trying to do is clean this up further.  In this example, the character has three attack options for melee attacks: warhammer, shield bash, and both.  I would like to clean these options into one button with a dropdown menu for choice.  I'm currently sitting on this for the macro: /em attacks @{target|character_name} /w gm ?{Power Attack value|0} ?{Flanking?|Yes,2|No,0} ?{Charge?|Yes,2|No,0} ?{Attack style|Mace attack,Warhammer attack: [[1d20+@{BAB}+@{Str mod}+1+1-?{Power Attack value}+?{Flanking?}+?{Charge?}]] Damage: [[1d8+@{Str mod}+1+?{Power Attack value}]]|Shield Bash,Bash attack: [[1d20+@{BAB}+@{Str mod}+1-?{Power Attack value}+?{Flanking?}+?{Charging?}]] Damage: [[1d3+(@{Str mod}/2)+?{Power Attack value}]]|Full round,Hammer attack: [[1d20+@{BAB}+@{Str mod}+1+1-2-?{Power Attack value}+?{Flanking?}+?{Charging?}]] Damage: [[1d8+@{Str mod}+1+?{Power Attack value}]] Shield attack: [[1d20+@{BAB}+@{Str mod}+1-2-?{Power Attack value}+?{Flanking?}+{Charging?}]] Damage: [[1d3+(@{Str mod}/2)+?{Power Attack value}]]} It starts out alright, asking for (in order) target, Power Attack value (input), Flanking (dropdown choice), Charging (dropdown choice), and finally Attack style, which asks for an input with default value of " Mace attack,Warhammer attack: [[1d20+5+4+1+1-?{Power Attack value ".  It looks like the problem is that it sees the end bracket around PAv as the end of the query.  Is there any way to fix this or am I going to have to leave this as three separate buttons?
Somewhat along these lines, there's another issue I'm having with a different attack button.  I'm trying to embed: /em fires her bow at @{target|character_name} Shortbow attack: [[1d20+@{BAB}+@{Dex mod}+2]] Damage: [[1d6+{@{Str mod},5}dh1]] (silver) and: /em fires her bow at @{target|character_name} Shortbow attacks: [[1d20+@{BAB}+@{Dex mod}+2]]/[[1d20+@{BAB}+@{Dex mod}+2-5]] Damage: [[1d6+{@{Str mod},5}dh1]]/[[1d6+{@{Str mod},5}dh1]] (silver) into a single dropdown choice button, but the might bow modifier ({@{Str mod,5}dh1}) seems to be screwing with the inquiry line if I try to use: /em fires her bow at @{target|character_name} ?{Attack|Standard,Shortbow attack: [[1d20+@{BAB}+@{Dex mod}+2]] Damage: [[1d6+{@{Str mod},5}dh1]] (silver)|Full round,Shortbow attacks: [[1d20+@{BAB}+@{Dex mod}+2]]/[[1d20+@{BAB}+@{Dex mod}+2-5]] Damage: [[1d6+{@{Str mod},5}dh1]]/[[1d6+{@{Str mod},5}dh1]] (silver)} Any ideas?
1603509472

Edited 1603509674
Oosh
Sheet Author
API Scripter
This is a very common issue. Queries use } , and | as control characters. To use them inside a Query you'll need to use HTML substitutions as outlined here. The other option is to get rid of the Query and use a Chat Menu instead. Note that you don't replace any characters in @{attributes} or %{abilities}. As far as math goes, it's usually a drop/keep highest/lowest causing the issue, as it contains both a , (comma) and a } (closing brace).
This was super helpful, it has fixed everything.  Thank you so much!