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

[5e OGL] Using the Neat npc/npcaction with PC Attacks

I really like the clean look of the npc attack rolls (although even with auto-damage roll on it doesn't roll - but that's another post).  I've been trying to create ability macros for my PCs to use the same template.  I get as far as rolling the attack roll, but when I try to add the damage, it still rolls under the atk template. Here's the working macro: @{selected|wtype}&{template:npcatk} {{name=@{selected|character_name}}} {{mod=@{selected|repeating_attack_$0_atkbonus} }} {{rname=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_dmg)}} {{rnamec=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_crit)}} {{r1=[[@{selected|repeating_attack_$0_hidden_r1base}@{selected|halflingluck}cs>@{selected|repeating_attack_$0_atkcritrange}@{selected|repeating_attack_$0_hidden_atkbonus} ]] }} @{selected|repeating_attack_$0_hidden_r2base}@{selected|halflingluck}cs>@{selected|repeating_attack_$0_atkcritrange}@{selected|repeating_attack_$0_hidden_atkbonus} ]] }} {{description=Range: @{selected|repeating_attack_$0_atkrange} }} {{desc=@{selected|repeating_attack_$0_atk_desc} }} @{selected|repeating_attack_$0_spelllevel} ammo=@{selected|repeating_attack_$0_ammo} @{selected|charname_output} The base for this was a macro in another thread which I can't find at the moment to reference.  It rolls correctly for both attack and damage. Just the presentation is under 2 different templates.  Is there a way to have the dmg display under the npcaction template? Thanks
1482891625
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi dmForLife, Take a look at the  5e OGL roll template wiki entry . The npc templates don't support a combined attack and damage roll formatting wise and the OGL templates don't allow custom fields unfortunately. you could do something like this: @{selected|wtype}&{template:npcatk} {{name=@{selected|character_name}}} {{mod=@{selected|repeating_attack_$0_atkbonus} }} {{rname=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_dmg)}} {{rnamec=[@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack_crit)}} {{r1=[[@{selected|repeating_attack_$0_hidden_r1base}@{selected|halflingluck}cs>@{selected|repeating_attack_$0_atkcritrange}@{selected|repeating_attack_$0_hidden_atkbonus} ]] }} @{selected|repeating_attack_$0_hidden_r2base}@{selected|halflingluck}cs>@{selected|repeating_attack_$0_atkcritrange}@{selected|repeating_attack_$0_hidden_atkbonus} ]] }} {{description=Range: @{selected|repeating_attack_$0_atkrange} }} {{desc=@{selected|repeating_attack_$0_atk_desc} }} @{selected|repeating_attack_$0_spelllevel} ammo=@{selected|repeating_attack_$0_ammo} @{selected|charname_output} @{selected|wtype}&{template:npcdmg} {{... This will have it as two separate roll template boxes output to chat, but will allow you to get the damage and attack output all at once. -Scott
Thanks.  I added the following code: @{selected|wtype}&{template:npcdmg} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[@{selected|repeating_attack_$0_dmgbase} + @{selected|repeating_attack_$0_dmgattr}]] }} {{dmg1type=@{selected|repeating_attack_$0_dmgtype}}} {{dmg2flag=@{selected|repeating_attack_$0_dmg2flag}}} {{dmg2=[[@{selected|repeating_attack_$0_dmg2base}+@{selected|repeating_attack_$0_dmg2attr}]]}}{{dmg2type=@{selected|repeating_attack_$0_dmg2type}}} Which works if you set the dmg2 to a non-empty value, or if you set the ability modifier of dmg2 to "-".  That's ok. The only issue now is that when the attack crits, it does not recognize it (since the roll is independent from the attack) and does not roll automatically.  Any thoughts?
1483196112
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I know it's not in the wiki, but try adding the field {{crit1=...}} in.
I added {{crit1=[[1d6]]}} to the npcdmg part.  Doesn't recognize the crits.  Tried adding it to the npcatk portion, same result. Looking at the HTML code, it seems I need to flag the crit with a {{crit=1}} flag.  Is there a way to send the result of the attack roll forward to the dmg roll?  (HTML code referenced below). <button type="roll" style="display: none;" name="roll_npc_dmg" value="@{wtype}&{template:npcdmg} @{damage_flag} {{dmg1=[[@{attack_damage}+0]]}} {{dmg1type=@{attack_damagetype}}} {{dmg2=[[@{attack_damage2}+0]]}} {{dmg2type=@{attack_damagetype2}}}"></button> <button type="roll" style="display: none;" name="roll_npc_crit" value="@{wtype}&{template:npcdmg} @{damage_flag} {{crit=1}} {{dmg1=[[@{attack_damage}+0]]}} {{dmg1type=@{attack_damagetype}}} {{dmg2=[[@{attack_damage2}+0]]}} {{dmg2type=@{attack_damagetype2}}} {{crit1=[[@{attack_crit}+0]]}} {{crit2=[[@{attack_crit2}+0]]}}"></button>
1483218737
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nope, other than the calling a critical / non critical version of the damage ability which is the way the sheet works normally
Thanks, Scott. I'm determined to solve this puzzle. &nbsp;So I took an npc dropped from the SRD and pulled the code for the template that rolls with the perfect format and the damage underneath: @{Steam Mephit|wtype}&{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}} {{dmg2flag=1}} {{name=@{Steam Mephit|npc_name}}} {{rname=Claws}} {{r1=[[1d20+(2+0)]]}} @{Steam Mephit|rtype}+(2+0)]]}} {{dmg1=[[1d4+0]]}} {{dmg1type=slashing}} {{dmg2=[[1d4+0]]}} {{dmg2type=fire}} {{crit1=[[1d4+0]]}} {{crit2=[[1d4+0]]}} {{description=}} @{Steam Mephit|charname_output} If you look closely, right in the middle where it says&nbsp;@{Steam Mephit|rtype}+(2+0) there are 2 extra closing brackets and 2 extra closing curly braces that have no corresponding opening counterparts. &nbsp;I'm not sure how such a syntax even works. &nbsp;Any ideas? I've also been looking at this post that suggests a similar syntax for npcaction: <a href="https://app.roll20.net/forum/post/2912956/5e-ogl-m" rel="nofollow">https://app.roll20.net/forum/post/2912956/5e-ogl-m</a>...
I ran across this just today, but the rtype syntax there means it will take the advantage from your sheet, whether you've chosen always roll advantage, or toggle, or whatever. It's strange syntax but somehow it works.&nbsp;