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

Need help adjusting a macro

1586660076

Edited 1586660117
I'm currently running this: [[ ?{Attack Type|Standard, 1d20 +5|Advantage, 2d20kh1+5|Disadvantage, 2d20kl1+5} ]] for standard d20 rolls with the drop down option of Standard, ADV and Disadv rolling. At the moment I currently have to edit the macro to add in the modifiers such as the +5 as shown.  I'm having trouble adding in a request to enter modifiers when the macro is executed.  When I add in  ?{Modifier|0} it wants to request a modifier to roll advantage instead of a number. I thought it would look like this but it doesn't work: [[ ?{Attack Type|Standard, 1d20 + ?{Modifier|0}|Advantage, 2d20kh1+ ?{Modifier|0}|Disadvantage, 2d20kl1+ ?{Modifier|0}} ]] Any help would b appreciated even if it's not possible to setup.  
1586665610
Kraynic
Pro
Sheet Author
Nesting queries starts getting into doing html replacements, I believe.  I'm not an expert on those.  I would recommend separating your queries.  See if this works for you. [[ ?{Attack Type|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}+?{Modifier|0} ]]
1586683185
Ziechael
Forum Champion
Sheet Author
API Scripter
Kraynic is 100% correct, to use your example (which is totally possible) as a teaching moment, it would look like this: [[ ?{Attack Type|Standard, 1d20 + ?{Modifier|0}|Advantage, 2d20kh1+ ?{Modifier|0}|Disadvantage, 2d20kl1+ ?{Modifier|0}} ]] However, as mentioned you are always best advised to only house within a query the things that need  to be different. In this case, since the modifier is universally applied regardless of the choice you are best off following Kraynic's example for a cleaner, easier to maintain, approach.
Thanks so much for the update to that.  It works great.  I was wracking my brain and Just couldn't get it working.  Thanks also for the teaching moment.  As I work on some other macros thats good info to have. Great work and thanks again.