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

How do I create Weapon or Spell Attack macros for the PCs?

1700326818

Edited 1700326861
Just started running Phandelver and Below and I was pleased to find that all the monster tokens have prebuilt Macros for initiative, saves, checks and attacks. I was able to copy the  initiative, saves, checks for the PCs but when I tried to copy the Light Crossbow Maco from the Bandit to a PC with with a Bow it attacks with a Light Crossbow. Is there a list of codes that cover the Weapons (and spells) that I can use OR is there another way to assign a Macro to a PCs Weapon attacks or Spells attacks? NOTE: I have zero coding skills and just basically copying the code to the PCs macros.
Hi DocMysterio We use the D&amp;D 5e by Roll20 sheet, so if you do too then this should apply. We use Gauss' MacroMule now, but when I had individual buttons on the various PCs, these were the macros for P/B and Slashing that we used (just name it and modify damage to suit each attack).&nbsp; Alternatively, make an attack with any weapon dragged in from the compendium, click in the chat window, press the UP arrow and it will give you the code for the last attack made, copy to block and use as you see fit.&nbsp; Spells, just drag and drop from compendium and they will sit in your spellbook, if it is not firing as expected, open it up with the cog and make sure it is set to Attack rather than Spellcard.&nbsp; Anyway, samples of our macros (explanations of all the fluff are here <a href="https://wiki.roll20.net/D%26D_5e_by_Roll20_Roll_Templates" rel="nofollow">https://wiki.roll20.net/D%26D_5e_by_Roll20_Roll_Templates</a>)... Slashing Weapon @{selected|wtype}&amp;{template:atkdmg} {{mod=+[[+2[MAGIC] + @{selected|strength_mod}[STR] + @{selected|PB}[PROF]]]}} {{rname=Adamantine Greataxe}} {{r1=[[@{selected|d20}cs&gt;20 + @{selected|strength_mod}[STR] + @{selected|PB}[PROF] + 2[MAGIC]]]}} @{selected|rtype}cs&gt;20 + @{selected|strength_mod}[STR] + @{selected|PB}[PROF] + 2[MAGIC]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + @{selected|strength_mod}[STR] + 2[MAGIC]]]}} {{dmg1type=Slashing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d12[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=[[1t[SWPN]]]}} {{spelllevel=}} {{innate=}} {{globalattack=@{selected|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{selected|global_damage_mod_type}}} ammo= @{selected|charname_output} Piercing Weapon @{selected|wtype}&amp;{template:atkdmg} {{mod=+[[@{selected|dexterity_mod}[DEX] + @{selected|PB}[PROF]]]}} {{rname=Light Crossbow}} {{r1=[[@{selected|d20}cs&gt;20 + @{selected|dexterity_mod}[DEX] + @{selected|PB}[PROF]]]}} @{selected|rtype}cs&gt;20 + @{selected|dexterity_mod}[DEX] + @{selected|PB}[PROF]]]}} {{attack=1}} {{range=80/320}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + @{selected|dexterity_mod}[DEX]]]}} {{dmg1type=Piercing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=[[1t[PWPN]]]}} {{spelllevel=}} {{innate=}} {{globalattack=@{selected|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{selected|global_damage_mod_type}}} ammo= @{selected|charname_output} Bludgeoning Weapon @{selected|wtype}&amp;{template:atkdmg} {{mod=+[[@{selected|strength_mod}[STR] + @{selected|PB}[PROF]]]}} {{rname=Mace}} {{r1=[[@{selected|d20}cs&gt;20 + @{selected|strength_mod}[STR] + @{selected|PB}[PROF]]]}} @{selected|rtype}cs&gt;20 + @{selected|strength_mod}[STR] + @{selected|PB}[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d6 + @{selected|strength_mod}[STR]]]}} {{dmg1type=Bludgeoning}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=[[1t[BWPN]]]}} {{spelllevel=}} {{innate=}} {{globalattack=@{selected|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{selected|global_damage_mod_type}}} ammo= @{selected|charname_output}
1700329254
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Doc Mysterio! The Token Actions (macros) for attacks that come with the characters in 5e and PF2 modules refer to specific attacks on the sheets. They cannot be copied from one to another. I.e. a goblin scimitar attack refers to the scimitar attack on the goblin sheet. If an attack is added, there is not automatic button generated, and if the scimitar is deleted, the button becomes useless. Some of them like checks can be copied, since they refer to attributes on sheets. I am surprised that the initiative action works on PCs, since that refers to a specific character by default. Also, many attributes are named differently for NPCs (who use statblocks) and PCs, (who use full character sheets). In short, the token actions use code that is very specific to the character and the attribute on the character, and cannot be transferred. If you ever consider upgrading to a Pro account, be aware that all of those token actions were created by a script available to Pro users: Token Action Maker. It has commands that let you generate those token actions but issuing a simple command in chat. You can even customize what types of actions are created.
And instead of using Token Actions for each character, you may be interested in using my Universal Statblock Macro Mule instead. You can import the Macro Mule character into your game and start using it in just a couple minutes.
Ok that solved my problem. Never knew you could do that. Thanks Simon G! Simon G. said: Alternatively, make an attack with any weapon dragged in from the compendium, click in the chat window, press the UP arrow and it will give you the code for the last attack made, copy to block and use as you see fit.&nbsp; Spells, just drag and drop from compendium and they will sit in your spellbook, if it is not firing as expected, open it up with the cog and make sure it is set to Attack rather than Spellcard.&nbsp;&nbsp;
NB, if you do make use of the macros above you need to change the description field to {{desc=desc}} since those macros reference rollable tables that give my tired DM brain flavour text to aid in describing combat