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

For D&D 5e, Is Sharpshooter best included as an API?

Hello folks!  I've been working at a macro formatted within the DnD 5e Roll20 Character Sheet's atkdmg Template, and I still have some issues with it.  I was wondering – if anyone would mind taking a look – whether or not it might be a better option to look for an API to solve my problem.  The macro as I have it looks like so below:  @{Alain Gilead|wtype}&{template:atkdmg} @{Alain Gilead|rtype}cf<2cs>19 + @{Alain Gilead|pb} + @{Alain Gilead|dexterity_mod} + @{Alain Gilead|FSArchery} - [[?{Sharpshooter?|No,0|Yes,1}*5]][SS] ]]}}{{mod=[[@{Alain Gilead|pb}[PB] + @{Alain Gilead|dexterity_mod}[DEX] + @{Alain Gilead|FSArchery}[FS] - [[?{Sharpshooter?|No,0|Yes,1}*5]][SS]]]}} {{rname=Pepperbox}} {{r1=[[@{Alain Gilead|d20}cf<2cs>19 + @{Alain Gilead|pb} + @{Alain Gilead|dexterity_mod} + @{Alain Gilead|FSArchery} - ?{Sharpshooter?|No,0|Yes,1}*5[SS] ]]}} {{attack=1}} {{range=80 ft. (320 ft.)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + @{Alain Gilead|dexterity_mod}[DEX] + [[?{Sharpshooter?|No,0|Yes,1}*10]][SS] ]] }}  {{dmg1type=Piercing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d10[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=The Pepper-Box misfires on a roll of [[2]] or less}} {{spelllevel=}} {{innate=}} {{globalattack=@{Alain Gilead|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Alain Gilead|global_damage_mod_type}}} ammo= @{Alain Gilead|charname_output} Now, it almost works fine, but there are a few issues I would love to resolve.  For one thing, there's a single attack box which always shows the formula of either 0*5 or 1*5 rather than simply 0 or 5, based on if Sharpshooter is used or not.  And actually, that might be the only issue.  I know I'd prefer to be able to have the descriptions "2" have a red font to match what a misfire / fumble on 2 would look like, but it's obviously not as irritating as that exposed calculation.   So while I'm looking for solutions within the current context, I thought I'd branch out and see if there were any ideas in this channel.  Any helpful replies much appreciated with thanks in advance, and a double heaping coming if a real solution presents itself!  :)
1592691898
David M.
Pro
API Scripter
Will this solution work for you? <a href="https://app.roll20.net/forum/post/8844634/slug%7D#post-8849078" rel="nofollow">https://app.roll20.net/forum/post/8844634/slug%7D#post-8849078</a>
It will and has been but I was curious, as some other people had suggested that an API might be an even superior method.&nbsp; :shrugs
1592693157
David M.
Pro
API Scripter
Got it. What about having two macros: One with sharpshooter hardcoded (so no formula), and another without sharpshooter, then a Query macro that calls the appropriate one. You would have to make html replacements for the pipes (|), commas(,), and brackets(}) in your two macros that get called. <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> So, that means putting them all in a character ability macro unless you never open the global macros again, due to the weird quirk with html replacements in global macros.