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

Is there a way to simplify this macro with 5 queries?

Info I'm a player DDBeyond for character sheet Roll20 for maps Not a pro subscriber Not using charactermancer for character sheets so ability/attribute macros are out I've recently learned about nesting macros and roll queries and hope that this can make a rather large, clunky macro I built more streamlined. Because I have 5 different arrows I can fire, I have different attack mods, damage mods, damage/crit die, and damage types. I'd love to be able to have 1 query ask me what kind of arrow I want to use, and all the other stuff populate accordingly. Macro as currently written: &{template:atkdmg} {{charname=Shadow}} {{rname=Killer Bow}} {{mod=+11}} {{r1=[[?{Rolling with| Standard,1d20cs>19| Advantage,2d20kh1cs>19| Disadvantage,2d20kl1cs>19} +11 +?{Attack Mod|Regular,0|Holy,1|Fire,1|Ice,1|Lightning,2|White,1}]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[?{Arrow Type|Regular,1d8+5|Holy,1d10+6|Fire,1d10+6|Ice,1d10+6|Lightning,1d12+7|White,1d12+6}]]}} {{dmg1type=?{Dmgtype|Regular,Piercing|Holy,Radiant|Fire,Fire DC 11 DEX Save or be set on fire for [[1d4]] fire damage|Ice,Cold DC 12 CON Save or speed is halved for 1 turn|Lightning,Lightning DC 12 CON Save or lose reaction for 1 turn|White, Darkness [[1d100]]}}} {{crit1=?{Crit|Regular, [[1d8]]|Holy, [[1d10]]|Fire, [[1d10]]|Ice, [[1d10]]|Lightning, [[1d12]]|White, [[1d12]]} Crit}} {{normal=1}} I'd really love to have ?{Arrow Type|Regular|Holy|Fire|Ice|Lightning|White} replace most of the other queries so I'm not dragging combat quite as much. Is this even possible? I know that nesting is cough  finicky cough . I also understand that Arrow Type is also already a query. This character was recently TPK'd so I can overhaul this macro. My thought process: Turn this: &{template:atkdmg} {{charname=Character}} {{rname=Killer Bow}} {{mod=+11}} {{r1=[[?{Rolling with| Standard,1d20cs>19| Advantage,2d20kh1cs>19| Disadvantage,2d20kl1cs>19} +11 +?{Attack Mod|Regular,0|Holy,1|Fire,1|Ice,1|Lightning,2|White,1} blah blah blah rest of the macro. Into this: &{template:atkdmg} {{charname=Character}} {{rname=Killer Bow}} {{mod=+11}}  ?{Arrow Type|Regular|Holy|Fire|Ice|Lightning|White}  {{r1=[[?{Rolling with| Standard,1d20cs>19| Advantage,2d20kh1cs>19| Disadvantage,2d20kl1cs>19} +11 + ?{Attack Mod | ?{Arrow Type} ,0| ?{Arrow Type} ,1| ?{Arrow Type} ,1| ?{Arrow Type} ,1| ?{Arrow Type} ,2| ?{Arrow Type} ,1} While trying to make this even somewhat coherent, I realized the underlined bit above may or may not be redundant. In all my previous attempts to figure this out on my own, I've been changing that to ?{Arrow Type}, along with everything else. Is what I'm wanting to do possible? My party I used this macro for knows I'm the "Macro Queen" and understand that this particular bow takes a bit of time to run because of all the queries.
1736540318

Edited 1736540389
Gauss
Forum Champion
Short version, no you cannot readily do what you want via queries. A query cannot have multiple outputs.  You could instead have each query go to a complete template, but that way lies HTML substitution madness. Instead, I recommend using Chat Menus . Then you can simply push two buttons (3 since you probably would still need the Advantage/Normal/Disadvantage query).  If you'd like me to walk you through that I'd be happy to do so.
1736541335

Edited 1736541600
Gauss
Forum Champion
How I would set this up: 1) On the character, add two attributes, one called "attackmod" and one called "damagemod" (without quotes). Put the values for the attack and damage mods (currently 11 and 5 if I am not mistaken).  This is so that mod changes do not require rewriting 5 macros.  2) I would write 6 Ability macros in the following fashion. I have added tags for each of the things so that they are more easily read when rolling.  Note the Ability names should be Regular, Holy, Fire, Ice, Lightning, and White (to match step 3) I have bolded the sections that should be changed for each damage type. Example: Fire gets replaced with Holy, the Fire damage is modified appropriately, etc.  &{template:atkdmg} {{charname=Shadow}} {{rname=Killer Bow ( Fire )}} {{mod=+@{attackmod}}} {{r1=[[?{Rolling with| Standard,1d20cs>19| Advantage,2d20kh1cs>19| Disadvantage,2d20kl1cs>19} +@{Attackmod}[atkmod] + 1[Fire] ]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[ 1d10+1[firedam] +@{damagemod}[dammod]]]}} {{dmg1type= Fire:  DC 11 DEX Save or be set on fire for [[1d4]] fire damage }}  {{crit1= [[1d10]][Fire crit] }} {{normal=1}} 3) I would then create the following macro:  &{template:default} {{name=Killer Bow}} {{[Regular](~Regular) [Holy](~Holy) [Fire](~Fire)}} {{[Ice](~Ice) [Lightning](~Lightning) [White](~White)}}
A query cannot have multiple outputs.  I remembered that after I tinkered more with the coding. I was hoping since the output was the same (asking what type of arrow I wanted to use) it would work. but that way lies HTML substitution madness. While I'm a glutton for punishment and wouldn't mind learning how to do nest and making in it work, this may not be the macro for that. As for chat menus, I'm always game to learn more about how this coding works so I can keep making shortcuts for my party. I find coding fun.
1736541936
Gauss
Forum Champion
One other note: I see you are using dmg1type to output a lot of text.  I would use {{desc=}} instead.  If setting up the above template for description instead I'd do it like this: (underlined the addition) &{template:atkdmg} {{charname=Shadow}} {{rname=Killer Bow ( Fire )}} {{mod=+@{attackmod}}} {{r1=[[?{Rolling with| Standard,1d20cs>19| Advantage,2d20kh1cs>19| Disadvantage,2d20kl1cs>19} +@{Attackmod}[atkmod] + 1[Fire] ]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[ 1d10+1[firedam]  +@{damagemod}[dammod]]]}} {{dmg1type= Fire }}  {{crit1= [[1d10]][Fire crit] }} {{normal=1}} {{desc= DC 11 DEX Save or be set on fire for [[1d4]] fire damage }}
This is how I would do it via chat menu:  &{template:npcaction} {{rname=Killer Bow }} {{description=[Regular arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +0]]}} {{r2=[[1d20cs>19 +11 +0]]}} {{dmg1=[[1d8+5]]}} {{dmg1type=Piercing}} {{crit1=[[1d8]] crit}}) [Holy arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +1]]}} {{r2=[[1d20cs>19 +11 +1]]}} {{dmg1=[[1d10+6]]}} {{dmg1type=Radiant}} {{crit1=[[1d10]] crit}}) [Fire arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +1]]}} {{r2=[[1d20cs>19 +11 +1]]}} {{dmg1=[[1d10+6]]}} {{dmg1type=Fire}} {{crit1=[[1d10]] crit}} {{desc=DC 11 DEX Save or be set on fire for [[1d4]] fire damage}}) [Ice arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +1]]}} {{r2=[[1d20cs>19 +11 +1]]}} {{dmg1=[[1d10+6]]}} {{dmg1type=Cold}} {{crit1=[[1d10]] crit}} {{desc=DC 12 CON Save or speed is halved for 1 turn}}) [Lightning arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +2]]}} {{r2=[[1d20cs>19 +11 +2]]}} {{dmg1=[[1d12+7]]}} {{dmg1type=Lightning}} {{crit1=[[1d12]] crit}} {{desc=DC 12 CON Save or lose reaction for 1 turn}}) [White arrow](!/
 %{@{character_name}|killerbowattack} {{r1=[[1d20cs>19 +11 +1]]}} {{r2=[[1d20cs>19 +11 +1]]}} {{dmg1=[[1d12+6]]}} {{dmg1type=Darkness}} {{crit1=[[1d12]] crit}} {{desc=Darkness: [[1d100]]}}) }} Then save the following as an ability on the character sheet: killerbowattack &{template:atkdmg} {{charname=Shadow}} {{rname=Killer Bow }} {{mod=+11}} {{attack=1}} {{?{Advantage|normal|advantage|disadvantage}=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}}
1736550474
Gauss
Forum Champion
Melissa, The advantage behind Tuo's method is it combines it all into one chat menu macro and one attribute.  The disadvantage is that it would make it harder to modify things. The method I provided makes it easier to add to and modify things later on.