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

problem using repeating_attack_$0_attack_dmg

hi I use D&D 5E  template and want run a macro for damage when target is hitting so for npc macro there is no problem : &{template:npcaction}{{rname=[Réussite]("style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block; width: 180px; color: blue; text-align:center )}}   {{description= dégats : [[@{selected|repeating_npcaction_$0_attack_damage}]] @{selected|repeating_npcaction_$0_attack_damagetype}  }} but for player it's make nothing &{template:npcaction}{{rname=[Réussite]("style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block; width: 180px; color: blue; text-align:center )}}   {{description= dégats : [[%{selected|repeating_attack_$0_attack_dmg}]] @{selected|repeating_attack_$0_dmgtype} }} after modify and use %{selected|repeating_attack_$0_attack_dmg} in place of [[%{selected|repeating_attack_$0_attack_dmg}]] I have this result : how have the same like npc : thank you
PC attacks do not have a single attribute that is used for calculating damage like NPCs do. NPC attacks have bonuses and things already added into the attack and damage rolls. PC damage rolls are calculated by the sheetworkers (bits of javascript code) when the damage button is pressed to add all of the relevant modifiers at that moment. Here's an example: @{Oran Gemglint|wtype}&{template:dmg} {{rname=Battleaxe (Two-Handed)}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d10 + 2[STR]]]}} {{dmg1type=Slashing}} 0 {{dmg2=[[0]]}} {{dmg2type=}} 0 {{desc=}}  {{spelllevel=}} {{innate=}} {{globaldamage=[[0]]}} {{globaldamagetype=@{Oran Gemglint|global_damage_mod_type}}} @{Oran Gemglint|charname_output} You can see in the 'dmg1' field there is a roll that adds any modifiers: {{dmg1=[[1d10 + 2[STR]]]}}   If I modify the attack and include a static damage mod, then the output changes slightly: {{dmg1=[[1d10 + 2[STR] + 3[MOD]]]}}  When you are calling that attribute (%{selected|repeating_attack_$0_attack_dmg}) on a PC, you are getting a long line of output that includes }} which close your description field. If you're set on this, you can recreate the roll yourself using this: [[@{selected|repeating_attack_$0_dmgbase}+0@{selected|repeating_attack_$0_dmgattr}+0@{selected|repeating_attack_$0_dmgmod}]] Which means your full macro will look like this: &{template:npcaction}{{rname=[Réussite]("style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block; width: 180px; color: blue; text-align:center )}}   {{description= dégats : [[@{selected|repeating_attack_$0_dmgbase}+0@{selected|repeating_attack_$0_dmgattr}+0@{selected|repeating_attack_$0_dmgmod}]] @{selected|repeating_attack_$0_dmgtype} }} If you're not already using it, you may be interested in a Universal Macro Mule Chat Menu approach to making rolls.
thank you Jarren for this good explanation