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

Attack macro, troubling with crits and second damage

Hi I trying to work on a macro for an attack, where the character have multiple option there can effect the to hit and damage. It does more or less work, but I run into to a couple of things, I would rather have, than this, for instance I like to see the number of dice rolled even for a critical hit, and I would prefer that the second damage only show up if the character choose to use an enchanted bowstring. Here is the macro I work on, the highlighted parts are where it doesn¨t seem to work as intended &{template:atkdmg} {{mod= +[[ @{dexterity_mod}[DEX]+@{pb}[Prof]+1[magic]+2[Misc]-?{Use Sharpshooter?|Yes,5|No,0}[Misc]]] }} {{rname=Longbow +1}} {{r1=[[1d20cs>20 +[[ @{dexterity_mod}[DEX]+@{pb}[Prof]+1[magic]+2[Misc]-?{Use Sharpshooter?|Yes,5|No,0}[Misc]]] ]]}} @{advantagetoggle}cs>20 +[[ @{dexterity_mod}[DEX]+@{pb}[Prof]+1[magic]+2[Misc]-?{Use Sharpshooter?|Yes,5|No,0}[Misc]]] ]]}}  {{attack=1}} {{range=150/600 ft.}} {{damage=1}}  {{dmg1flag=1}} {{dmg1=[[1d8+[[?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))]]d6+?{Hunter's Mark?|Yes,1|No,0}d6 +[[ @{dexterity_mod}[DEX]+1[Magic]+2*?{Use Sharpshooter?|Yes,5|No,0}[Misc] ]]]] }} {{dmg1type=piercing}} {{dmg2flag= ?{enchanted bowstring|No,0|Yes,1} }} {{dmg2=[[?{enchanted bowstring|No,0|Yes,1}d10]]}} {{dmg2type=?{String-type|Normal, |Blazing,fire|Freezing,cold|Lightning,lightning}}} {{crit1= [[[[1d8+?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))d6+?{Hunter's Mark?|Yes,1|No,0}d6 ]]]] }} {{crit2=[[?{enchanted bowstring|No,0|Yes,1}d10]]}}  {{desc=**@{selected|character_name}** ***attacking*** **@{target|token_name}** with her Longbow +1}} The problem with dmg2flag is that if I select no, then the answer probably should be blank, so it won't include damage 2 at all, but is that even possible. The problem with the crit is that if I copy down from the normal damage output and remove the non-dice part, then it doesn't roll the damage but just write the text.  [[1d8+[[?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))]]d6+?{Hunter's Mark?|Yes,1|No,0}d6 ]], so not completely sure what I do wrong, since it works with the normal damage. I am using the roll20 sheet for dnd 5e. Hope it makes sense, and looking forward to any help I can get.
1552750729
GiGs
Pro
Sheet Author
API Scripter
For {{dmg2flag= ?{enchanted bowstring|No,0|Yes,1} }} you probably need to enclose it in inline roll brackets, to force the roll template to recognise it as a number. Like this: {{dmg2flag=[[ ?{enchanted bowstring|No,0|Yes,1}]] }} notice the dmg2 that directly follows does the same thing For the second one, the only problem i can see is you have too many [[ ]] which might be the issue. It wouldnt be a problem in normal macros, but maybe it screws up in rolltemplates. Try changing it to {{crit1= [[1d8+?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))d6+?{Hunter's Mark?|Yes,1|No,0}d6 ]]  }}
GiGs said: For {{dmg2flag= ?{enchanted bowstring|No,0|Yes,1} }} you probably need to enclose it in inline roll brackets, to force the roll template to recognise it as a number. Like this: {{dmg2flag=[[ ?{enchanted bowstring|No,0|Yes,1}]] }} notice the dmg2 that directly follows does the same thing For the second one, the only problem i can see is you have too many [[ ]] which might be the issue. It wouldnt be a problem in normal macros, but maybe it screws up in rolltemplates. Try changing it to {{crit1= [[1d8+?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))d6+?{Hunter's Mark?|Yes,1|No,0}d6 ]]  }} For the second part... the problem is, if I use your suggestion, it will write the formula, when you look at what has been rolled, and that was kinda what I wanted to not see, rather just see an actual number, 1d6, 2d6, etc. when it also comes to sneak attack. And it does do that in the normal damage, but not in the critical hit damage. But maybe it is messing up to have that many brackets... For the first part, will dmg2flag=0 do, that it doesn't show the second damage, because then I can easily write just 1d10 in the actual damage, but so far I just try to let it roll 0d10 in case it is a normal bowstring.
GiGs said: For {{dmg2flag= ?{enchanted bowstring|No,0|Yes,1} }} you probably need to enclose it in inline roll brackets, to force the roll template to recognise it as a number. Like this: {{dmg2flag=[[ ?{enchanted bowstring|No,0|Yes,1}]] }} notice the dmg2 that directly follows does the same thing For the second one, the only problem i can see is you have too many [[ ]] which might be the issue. It wouldnt be a problem in normal macros, but maybe it screws up in rolltemplates. Try changing it to {{crit1= [[1d8+?{Sneak Attack?|Yes,1|No,0}*(ceil(@{multiclass1_lvl}/2))d6+?{Hunter's Mark?|Yes,1|No,0}d6 ]]  }} Actually after controlling about the critical hit, it doesn't roll the dice other than the 1d8. Everything else is just a static number, for instance if multiclass1_lvl = 8, then it says 1 times 4, so 1d8+4 for the crit. Where it should be 1d8 + 4d6 + 1d6
1553917149
GiGs
Pro
Sheet Author
API Scripter
I'm at my limit to help you sadly, I don't know the character sheet, rolltemplate, or system you're using and was just making educated guesses. Hopefully someone else will have ideas.