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

Template with dropdown

October 02 (5 years ago)

Hi!


I'm pretty new creating macros and I am having a lot of trouble. I just want a dropdown with default tables as output.


Which attack are you doing? And then to select between sword or dagger. When picked one of them, the default table with two lines are displayed, one line for attack roll and one for damage roll.


Is that so hard? Could you please help me?


Thanks a lot!!!


October 03 (5 years ago)
vÍnce
Pro
Sheet Author

Hi Jaun,

What sheet/system are you using?  There may be some easy solutions available depending on your sheet/system. 

IMO, instead of trying to wrestle with drop-downs, character substitutions and nested queries...  I would recommend Chat Menus (make an "Attack Menu" macro that includes buttons to roll a weapon's attack and damage) 

October 03 (5 years ago)

Well, I'm using DnD 5e but we are not using the sheet because we have it on DnD Beyond. You could say we don't use any system.

The thing I want to do -If it's posisble- is to have this...

...after a dropdown.


What attack are you doing? -> Dropdown to select (Sword) (Dagger) -> It shows the default template (see above) after choosing.


Thanks!

October 03 (5 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

100% possible, might require some knowledge of the html replacements Vince linked to. What sort of information is needed to be entered manually? Attack bonus, damage bonus etc? Do you have no attributes stored in Roll20 at all?

The essence of a drop down query is to give set results based on your selection, if all you need to do is vary the attack/damage mod then you are best off with a basic template like your example with manual queries:

&{template:default} {{name=Attack}} {{attack=[[1d20 + ?{Attack Modifier}]]}} {{Damage=[[?{Damage Calculation}]]}}

You could replace the attack/damage calculation with a couple of preset options though:

&{template:default} {{name=Attack}} {{attack=[[1d20 + ?{Attack Modifier|Melee,2|Ranged,3}]]}} {{Damage=[[?{Weapon|Sword,1d8+2|Dagger(Melee),1d4+2|Dagger(Thrown)|1d4+3}]]}}

To only have 1 query to rule them all you will be in html replacement territory but once we know more of your setup we can address that accordingly with some examples for you :)

October 04 (5 years ago)


Ziechael said:

100% possible, might require some knowledge of the html replacements Vince linked to. What sort of information is needed to be entered manually? Attack bonus, damage bonus etc? Do you have no attributes stored in Roll20 at all?

The essence of a drop down query is to give set results based on your selection, if all you need to do is vary the attack/damage mod then you are best off with a basic template like your example with manual queries:

&{template:default} {{name=Attack}} {{attack=[[1d20 + ?{Attack Modifier}]]}} {{Damage=[[?{Damage Calculation}]]}}

You could replace the attack/damage calculation with a couple of preset options though:

&{template:default} {{name=Attack}} {{attack=[[1d20 + ?{Attack Modifier|Melee,2|Ranged,3}]]}} {{Damage=[[?{Weapon|Sword,1d8+2|Dagger(Melee),1d4+2|Dagger(Thrown)|1d4+3}]]}}

To only have 1 query to rule them all you will be in html replacement territory but once we know more of your setup we can address that accordingly with some examples for you :)


UoU, Thanks a lot! I understand the strecture now! So helpful!

This will make our sessions soooo much enjoyable!


October 04 (5 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

You are most welcome, shout out if you need any more help as you delve further and further into the murky world of advanced custom macros... :)