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 results of macro dropdown list both text and a roll without being separate lines?

I'm trying to have an attack macro that gives a drop down selection list for selecting "Standard", "Advantage" and "Disadvantage" rolls and displays that information alongside the roll. Example: &{template:default} {{name=@{attack_name_1}}} {{damage type=@{attack_type_1}}} {{attack Roll=[[?{Roll Type|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1}+@{attack_bonus_1}]]}} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]]}} Which currently results in: ((( Well, it seems the pasted image didn't make it into this post for some reason. Anyway, it is just the standard attack roll result in the default template, so many of you probably know what that looks like anyway. Sorry. ))) I'm wanting to add the effect of the resulting template box also showing alongside the attack roll result whether the roll was made as a Standard roll or with Advantage or Disadvantage.  I know I can hover my mouse pointer over the number (the 24 in this case) and see that already, but I want it to post it instead. I know I could create a second query and have the person making the roll select "Advantage" on the first query (to get it to roll with advantage) and then they could select it again on a second query (to get it to say "Advantage" on another line entry).  But that isn't what I'm looking to do.  I just want to select "Advantage" (for example) once in a drop down and have it do two things because of that (roll with advantage and write out "Advantage" (or "Adv") next to the roll, posted in the results).  I've tried several ways that I thought would work, but I don't seem to be having any luck.  Any help would be appreciated.  Thanks, in advance.  (Oh, and I don't have access to API scripting, if that makes a difference.)
1591488605

Edited 1591502172
Oosh
Sheet Author
API Scripter
The Query can't output two different results as you're hoping. To achieve what you want, you would have to change the Query to this kind of setup: &{template:default} {{name=@{attack_name_1}}} {{damage type=@{attack_type_1}}} {{attack Roll=[[?{Roll Type|Normal, <normal roll attack macro> | Advantage, <advantage roll attack macro> | Disadvantage, <disadvantage roll attack macro> } And then nest the rest of your roll template into each bolded section, using HTML replacement for any non-Attribute curly brackets that occur for the rest of the template. If the parser gets to a } closing bracket inside the Query that is not part of an Attribute reference, it will end the Query and dump the rest of your macro into chat. I'll get you started with the no-advantage roll: &{template:default} {{name=@{attack_name_1}}} {{damage type=@{attack_type_1}}} {{ attack Roll=[[?{Roll Type|Normal, 1d20 + @{attack_bonus_1} ]]}} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]]}} {{Advantage Type=Normal}} | Advantage, <advantage version goes here> | Disadvantage, <disadvantage version goes here> } So if you replace the 2 second bolded sections with a modified version of the first bolded bit, you should be good! Remember never to use HTML replacement (the } in this case) in your Attribute calls, e.g. @{attack_damage_1}
Thanks a ton for the response and the assistance.  That still wasn't QUITE what I was looking for, as it still listed the "Advantage Type = Normal" on another line and I was looking to have that listed on the same line as the attack roll, just right after the roll.  But it gave me something to work with and it really helped me get to where I wanted with this request.  So, here's my final outcome (and it is exactly what I was trying to accomplish): &{template:default} {{name=@{attack_name_1}}} {{Attack Roll=[[?{Roll Type|Standard,1d20 + @{attack_bonus_1} ]] Standard}} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]] @{attack_type_1}}}|Advantage,2d20kh1 + @{attack_bonus_1} ]] Advantage}} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]] @{attack_type_1}}}|Disadvantage,2d20kl1 + @{attack_bonus_1} ]] Disadvantage}} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]] @{attack_type_1}}}} I am using this for my Carbon 2185 game and the sheet that is in Roll20 has a few quirks about it that I wasn't fond of, so I prefer this instead.  It only has 4 weapon slots on the sheet, so I would just end up replacing the "1"s with "2"s, "3"s, and "4"s for those other weapon slots of course.  For some reason, the first slot was created to roll the attack roll twice when you selected it on the character sheet (for Adv/DisAdv), but this made the attack block take up a lot of real estate in the side chat window and I was looking to reduce that real estate usage as much as possible, while still providing the information that normally was provided when you selected a weapon on the character sheet for an attack roll.  The final solution that I just posted ended up with a final product that only has the purple title bar (showing the weapon's name) and two lines of data beneath that (one with the attack roll and whether it is a Standard roll or made with Adv/DisAdv, and one with the damage roll and listing what damage type was inflicted).  So, this is WAY more compact and useful for my purposes and it wouldn't have been possible without your assistance.  So, thanks again.
1591573125
Oosh
Sheet Author
API Scripter
No problem, nice work getting it how you want it!
1591614052
Ziechael
Forum Champion
Sheet Author
API Scripter
It's a learning curve for sure but you are using a lot of unnecessary repetition and therefore html that isn't needed. Here is a stripped down version that is functionally identical for you to compare and further your learning with: &{template:default} {{name=@{attack_name_1}}} {{Attack Roll=?{Roll Type|Standard,Standard: [[1d20|Advantage,Advantage: [[2d20kh1|Disadvantage,Disadvantage: [[2d20kl1} + @{attack_bonus_1} ]] }} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]] @{attack_type_1} }}
Ziechael, thanks for that as well.  That IS a bit more manageable, even though it has to switch the location of the attack descriptor to before the roll in order to work.  But at least it does take up a lot less space to do it ultimately.  I was trying to get something like that to work before as I described in the original post, but I guess once the roll brackets are started (the "[["), the calculation process has to come to completion without a textual break, like I was looking to add.  So, it makes sense in that case to put the descriptor in front of the calculation, I guess.  Like you said, it's a learning curve and I'm only recently starting, personally.  Thanks for the assist though. Much appreciated.
1591774267
Ziechael
Forum Champion
Sheet Author
API Scripter
If you REALLY want the text descriptor after the roll: &{template:default} {{name=@{attack_name_1}}} {{Attack Roll= [[  @{attack_bonus_1} +  ?{Roll Type|Standard,1d20 ]] Standard|Advantage,2d20kh1 ]] Advantage|Disadvantage,2d20kl1 ]] Disadvantage} }} {{damage=[[@{attack_damage_1}+@{attack_dmod_1}]] @{attack_type_1} }} As you rightly surmise, once you are in an inline roll you need to see it out before you can apply variable text... in this case simply swapping the start of the roll with the end of the roll again reduces the need for duplication or html replacements. It's a whole new mindset when working with Roll20 macros but most things are possible once you've wrapped your mind around it... I've never been closer to Cthulhu personally!
Cool! Even better (for what I'm looking for, at least). Again, much appreciated. Thanks.