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

Select an arrow, change the mods appropriately

I've fallen down the rabbit hole of creating macros, and have fallen in love. Unfortunately for me, I'm having to learn on the fly and don't always quite know what I'm doing. Google searches have helped me figure out what I want to do......until now. I'm using Beyond20 to bridge D&DBeyond and Roll20, so can't access the API to make changes that way. I'm a Ranger/Rogue and I have a +1 long bow, and 6 different arrows to choose from for ammunition. Each arrow type adds a +1 or +2 to my attack and damage rolls. Is there a way to incorporate this into the macro I've made for my longbow? Ideally, I'd like it to replace the "Piercing" and dmg tags when I select the different ammo. Example, if I choose Lightning arrow the dmg1 would change to roll 1d12+6, and the dmg1type would change to Lightning, also add the +2 to the attack roll. Code as it is now (what I use for firing Iron arrows): &{template:atkdmg} {{charname=Shadow}} {{rname=Longbow}} [[?{Attack Type| Standard,1d20| Advantage,2d20kh1| Disadvantage,2d20kl1}]]  {{mod=+10}} {{r1=[[?{Attack Type} +10]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8+4]]}} {{dmg1type=Piercing}} {{crit1=Crit: [[1d8]]}} {{dmg2flag=1}} {{dmg2=?{Sneak Attack|No, 0|Yes, [[1d6]] }}} {{dmg2type=Sneak Attack}} {{crit2=Crit: [[1d6]]}} {{normal=1}} What I want to add: a choice between the following: Iron (standard arrow, no changes), Holy (+1 Radiant damage), Fire (+1 Fire damage), Ice (+1 Cold damage), Lightning (+2 Lightning damage), White (unidentified at this time, place holder for when I do know) Is what I want possible? Is it better to keep the base as I've written it, and try to remember the additional info when rolling? I do have different macros for the different arrow damages. Bonus points if there's a way to add DC's into this quickly growing monster. Pic for reference:
1713994288

Edited 1713994331
Gauss
Forum Champion
Basically you can add a query to the dmg1 field.  [[1d8+4 +?{Arrow type|Iron,0[Normal]|Holy,1[Radiant]|Fire,1[Fire]|Ice,1[Cold]|Lightning,2[Lightning]}]] Then in the dmg1type field you change Piercing to:  Piercing / ?{Arrow type?|Iron, |Holy,Radiant|Fire,Fire|Ice,Cold|Lightning,Lightning} Note: if you don't want two queries you can just use the first query, and hover over the results if you need to double check the damage type.  When you add "White" you can tweak the above. 
Gauss said: Basically you can add a query to the dmg1 field.  [[1d8+4 +?{Arrow type|Iron,0[Normal]|Holy,1[Radiant]|Fire,1[Fire]|Ice,1[Cold]|Lightning,2[Lightning]}]] Then in the dmg1type field you change Piercing to:  Piercing / ?{Arrow type?|Iron, |Holy,Radiant|Fire,Fire|Ice,Cold|Lightning,Lightning} Note: if you don't want two queries you can just use the first query, and hover over the results if you need to double check the damage type.  When you add "White" you can tweak the above.  Will that also give a +1 or +2 to the attack roll?
Gauss said: Basically you can add a query to the dmg1 field.  [[1d8+4 +?{Arrow type|Iron,0[Normal]|Holy,1[Radiant]|Fire,1[Fire]|Ice,1[Cold]|Lightning,2[Lightning]}]] Then in the dmg1type field you change Piercing to:  Piercing / ?{Arrow type?|Iron, |Holy,Radiant|Fire,Fire|Ice,Cold|Lightning,Lightning} Note: if you don't want two queries you can just use the first query, and hover over the results if you need to double check the damage type.  When you add "White" you can tweak the above.  Thank you for the starting point!!! I got it mostly figured out. My next question: Is there a way to condense the queries so I only have to select Iron/Holy/Fire/etc. one time and it fills in the rest of the information? I want to keep the Standard/Advantage/Disadvantage and Sneak Attack as their own queries. What I have now: &{template:atkdmg} {{charname=Shadow}} {{rname=Longbow}} [[?{Attack Type|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}]] {{mod=+10}} {{r1=[[?{Attack Type} +10 +?{amod|Iron,0|Holy,1|Fire,1|Ice,1|Lightning,2}]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[?{Arrow type|Iron,1d8+4|Holy,1d10+5|Fire,1d10+5|Ice,1d10+5|Lightning,1d12+6}]]}} {{dmg1type=?{Damage type|Iron,Piercing|Holy,Radiant|Fire,Fire|Ice,Cold|Lightning,Lightning}}} {{crit1=?{Crit Die|Iron,[[1d8]]|Holy,[[1d10]]|Fire,[[1d10]]|Ice,[[1d10]]|Lightning,[[1d12]]}}} {{dmg2flag=1}} {{dmg2=?{Sneak Attack|No, 0|Yes, [[1d6]]}}} {{dmg2type=Sneak Attack}} {{crit2=Crit: [[1d6]]}} {{normal=1}}
1714003700

Edited 1714004338
Gauss
Forum Champion
Oops, I missed it also applied to attack.  If the bonus is +1 attack and +1 damage you can use the same query for both.  However, I see you changed your damage dice for the damage section, that will necessitate different queries.  Regarding Sneak Attack, I would remove it as a query and have it rolled all the time. Just mentally factor it in or not. (This is what my players do.) I think this can be cleaned up to use a couple fewer queries but I'll have to look at it later. I also see a query called ?{Attack type}, what is that query doing?
Gauss said: Oops, I missed it also applied to attack.  If the bonus is +1 attack and +1 damage you can use the same query for both.  However, I see you changed your damage dice for the damage section, that will necessitate different queries.  Regarding Sneak Attack, I would remove it as a query and have it rolled all the time. Just mentally factor it in or not. (This is what my players do.) I think this can be cleaned up to use a couple fewer queries but I'll have to look at it later. I also see a query called ?{Attack type}, what is that query doing? Being redundant. I first started by copying the code from a roll on DndBeyond, and have been tinkering with it since.  I cleaned that up. I'm also taking out the sneak attack and will make that its own roll. Due to my DM's playstyle, I don't get it very often.
1714182532

Edited 1714182672
The problem with the query function is that it can only return one value at a time so you need to have multiple queries.  If you want to go further down the rabbit hole you can use a chat menu to display buttons for each arrow type then add corresponding abilities to you character sheet for each arrow type. This will reduce the number of queries since you can edit each ability to the specific attack mod, damage, and damage type for each arrow type.  You can also add buttons to your chat menu for add-on damage like sneak attack, hunter's mark, and favored foe that you can click on when they apply. Example chat menu: /w @{Shadow|character_name} &{template:traits} {{name=Long Bow Attack}} {{description=[Iron Arrow](~Shadow|iron_arrow) [Holy Arrow](~Shadow|holy_arrow) [Fire Arrow](~Shadow|fire_arrow) [Ice Arrow](~Shadow|ice_arrow) [Lightning Arrow](~Shadow|lightning_arrow) **Add on Damage** [Favored Foe](~Shadow|favored_foe_dmg) [Crit. Damage](~Shadow|favored_foe_crit) [Hunter's Mark](~Shadow|hunters_mark_dmg) [Crit. Damage](~Shadow|hunters_mark_crit) [Sneak Attack](~Shadow|sneak_attack_dmg) [Crit. Damage](~Shadow|sneak_attack_crit) [Zephyr Strike](~Shadow|zephyr_strike_dmg) [Crit. Damage](~Shadow|zephyr_strike_crit) }} Of course you will need to add the corresponding abilities for each button.
1714188177
Gauss
Forum Champion
Yeah, I think I'd have to agree with Ryan85202 on using a Chat Menu here.
1714332813

Edited 1714429614
Thank you both for all your help. I'll have to look at chat menu coding some more. It's not making a whole lot of sense to me right now. That's okay. Give me more to look at and learn about. The biggest wrench in the machine for a lot of what I want to do is that I'm not using a Roll20 character sheet . It's all interfacing between roll20 and dndbeyond. I've taken a couple of steps back and have gone with something a lot less complicated, has fewer queries, and still does what I want. Longbow: &{template:atkdmg} {{charname=Shadow}} {{rname=Longbow}} {{mod=+10}} {{r1=[[?{Attack Type| Standard,1d20| Advantage,2d20kh1| Disadvantage,2d20kl1} +10 +?{attkmod|Iron,0|Holy,1|Fire,1|Ice,1|Lightning,2}]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[?{Iron Arrow|Yes,1d8+4|No,0}]]}} {{dmg1type=Piercing}} {{crit1=Crit: [[1d8]]}} {{normal=1}} Then I have buttons for each arrow type, dread ambusher, sneak, and all of that. I would love to have something that does it all with a couple of clicks, but I'm not proficient in that yet. I hope to get there some day.
1714340389

Edited 1714341643
Gauss
Forum Champion
Melissa, I can walk you through Chat Menus.  1: In the Roll20 game go to your Roll20 character sheet 2: Go to the Attributes and Abilities tab (very top of the Roll20 Character) 3: On the ABILITIES side, click "Add" 4: Click the "pencil" icon to open it 5: Name it: Longbow 6: put this into the body of "Longbow" (under the name):  &{template:default} {{name=Longbow}} {{Select one= [Iron Arrow](~IronArrow)%NEWLINE%[Holy Arrow](~HolyArrow)%NEWLINE%[Fire Arrow](~FireArrow)%NEWLINE%[Ice Arrow](~IceArrow)%NEWLINE%[Lightning Arrow](~LightningArrow)%NEWLINE%[White Arrow](~WhiteArrow)}} 7: Click the checkmark to close it. Test it. Note: each button will be able to be pressed but it will spit out errors until the destination Ability macros are made below.  8: Click Add again 9: Click the pencil icon to open it 10: Name it: IronArrow Put this into the body: &{template:atkdmg} {{charname=Shadow}} {{rname=Longbow}} {{mod=+10}} {{r1=[[?{Attack Type| Standard,1d20| Advantage,2d20kh1| Disadvantage,2d20kl1} +10]]}} {{attack=1}} {{range=150ft./600ft.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[ 1d8+4 ]]}} {{dmg1type=Piercing}} {{crit1=Crit: [[ 1d8 ]]}} {{normal=1}} 11: Click the checkmark to close it.  Repeat steps 8-11 for each arrow type, making changes to the damage and crit fields (bolded above) as appropriate. For step 10 name it HolyArrow, IceArrow, etc.