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

Inline Question within a Button

I have a player that has the ability to add elemental damage to any attack and I wanted to give them a button that will prompt them to choose what elemental damage they can choose. This is what I have so far (testing on the Shatter spell): &{template:dmg} {{save=1}} {{saveattr=CON}} {{savedesc=Shatter}} {{savedc=@{selected|spell_save_dc}}} {{desc=***A Thunderous Boom emanates from a single point causing all those within a 10ft radius to take damage!***}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[[[?{What level?|2nd,3|3rd,4|4th,5|5th,6|6th,7|7th,8|8th,9|9th,10}]]d8]]}} {{dmg1type=Thunder}} {{dmg2flag=1}} {{dmg2=[Elemental](`#&{template:default} {{name=Acid Damage!}} {{Damage=[[1d6[Acid]]]}})}} Where it says [Acid] I would like it to resolve to a question to prompt which damage type they can choose from a list. So far I can only get it to ask the question when they first choose the level of the spell, but I want it to ask the question after they click the "Elemental" button.
1705512700

Edited 1705512985
Gauss
Forum Champion
Hi FoxRobinHood,  In dmg2type I would simply put a query.  ?{Damage Type?|Acid,Acid|Cold,Cold|Electricity,Electricity|Fire,Fire}  This looks like it might be based on the D&D 5e by Roll20 sheet?  If so, put Shatter on the sheet normally, then go edit the attack (on the Core page), put the damage in the Damage 2 line, and the above query in the damage type of the damage 2 line (red box below). 
Thanks for the response.  We are doing these Token macros so we do not have to flip back and forth to the character sheet.  The player has an optional choice to change and add an elemental damage and so that is why I was trying to make it a button so that it would only roll if the damage type if it was actually changed.  Otherwise, we do not want the damage to be rolled (E.g. sometimes Thunder Damage from Shatter is what is best for the situation)
1705516336

Edited 1705516492
Gauss
Forum Champion
FoxRobinHood said: Thanks for the response.  We are doing these Token macros so we do not have to flip back and forth to the character sheet.  The player has an optional choice to change and add an elemental damage and so that is why I was trying to make it a button so that it would only roll if the damage type if it was actually changed.  Otherwise, we do not want the damage to be rolled (E.g. sometimes Thunder Damage from Shatter is what is best for the situation) So about that, you can create token macros by dragging the button to the bottom of the sheet.  Then press the macro button that is created, stick that command into the Ability macro (which then you checkmark for Token Macro).  Finally you drag the macro button off the Macro Bar.  This makes it so that your Ability macros are easier to update, simply update the attack on the sheet.  Put another way, it is usually better to update the attack than a macro, so make the macro reference the attack instead.  As for the button, could you elaborate on the exact decision tree being used?  My understanding of your initial post is that you were trying to change damage type on a second damage roll.
  What I have:  A macro that replicates "Shatter" that asks what spell level the caster wants to cast it at and then adjusts the damage accordingly.  It also has a button called "Elemental" that casts a d6 when clicked. What I want: When the button called "Elemental" is clicked it asks what type of damage so the output in the purple box can change based on their decision. (What is shown in the purple box only is submitted to the chat only after the "Elemental" button is pushed)
1705518405

Edited 1705518442
Gauss
Forum Champion
Here you go:  &{template:default} {{name=?{Damage type?|Acid,Acid|Cold,Cold}}} {{Damage=[[1d6]]}} Stick that in an Ability, then put the Ability into the Button.  [Elemental](~Charactername|Abilityname) Note: I didn't complete the Damage type with all the damage types, but you can do that. 
If you want to use a query without an additional ability you can replace the question mark with it's HTML entity. You could use this for your button [Elemental](`#&{template:default} {{name=?{Damage Type?|Acid|Cold|Electricity|Fire} Damage!}} {{Damage=[[1d6[?{Damage Type?}]]]}})
Both options worked great.  Thanks so much!