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

Automatically applying STR+DEX to attack and damage rolls

1618346485

Edited 1618346546
Hi! I'm brand new to the idea of APIs, but I have an issue with a long campaign I'm in where I'm playing a Samurai and I think an API might be the solution. Essentially, my DM and I decided to allow me to apply both my STR and DEX modifiers to attack and damage rolls when I invoke "Fighting Spirit". I've been puzzling over how to make this as automatic and streamlined a process as possible since right now I have to remember to tick off two global modifier boxes as well as making sure the manually input numbers match my modifiers as I level up. Since the campaign starts at level 1 and will proceed to 15 at least, it seems worth trying to automate this process as much as possible. Is there a way to link a single button, or something to that effect, to modifying both attack and damage rolls which will automatically scale with both my STR and DEX modifiers? Thank you in advance!  (Edited for clarity)
Are you playing D&D 5th Edition, and is your game using the D&D 5E by Roll20 character sheet? If so, the easiest way is simply to use the global attack and damage modifer fields.  Yes, you'll have to update them as you level up, but there's likely less chance for error. However, if you really want to make it so that your DEX and STR mods are added to each attack, there's a clunky workaround . In your case, click on your character and click any attack roll.  Then go to the chat menu and press the up arrow, you should get something like this (your actual values will be different): @{CHARACTERNAME|wtype}&{template:atkdmg} {{mod=+5}} {{rname=Shortsword}} {{r1=[[@{CHARACTERNAME|d20}cs>20 + 2[DEX] + 3[PROF]]]}} @{CHARACTERNAME|rtype}cs>20 + 2[DEX] + 3[PROF]]]}} {{attack=1}} {{range=Melee 5 ft}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + 2[DEX]]]}} {{dmg1type=Piercing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}}   {{spelllevel=}} {{innate=}} {{globalattack=@{CHARACTERNAME|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{CHARACTERNAME|global_damage_mod_type}}} ammo= @{CHARACTERNAME|charname_output} You only want the {{r1}} and {{dmg1}} sections, bolded in my example above. Take those sections and use this: }} {{r1=[[@{d20}cs>20 + @{dexterity_mod}[DEX] + @{strength_mod}[STR] + @{pb}[PROF]]]}} {{dmg1=[[1d6 + @{dexterity_mod}[DEX] + @{strength_mod}[STR] ]] You can see the bolded sections that I added in.  Go to the Attributes tab and put that entire line into one of the attributes that comes after  the damage fields, e.g. in the 'global_damage_mod_type' field if that's unused. Big caveat on this: if you ever click on whatever field is being used to insert your override for the {{r1}} and {{dmg1}} fields ('global_damage_mod_type' in my example), then you'll have to put this code back into it.  The sheet workers will overwrite whatever is in these fields when they get updates, so you'll have to find a field that you're not going to use otherwise.  Luckily it should be easy enough to just paste this into the field again -- if it's a field that is in use, make sure to paste it after whatever is there already.
Goodness you were'nt lying, just doing it manually is definitely the better choice. Thank you very much for your help though! I hope I can make use of APIs in the future as a player since they seem like they have a lot of potential.