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

Creating Multiattack macro for Pathfinder Comunity sheet bug (in my code?)

Alright so, I have a PC with 9 natural attacks (it's a crazy game), and want to make a 1 button macro for all of them. After digging around, and getting assistance from a friend, I've got: <a href="https://pastebin.com/cfnVCUwQ" rel="nofollow">https://pastebin.com/cfnVCUwQ</a> Which is ugly. So I'll show you also how it's generated: const attackOrder = [0,0,1,2,3,4,4,5,5] const characterName = "Read Gale" const head = `@{PC-whisper} &amp;{template:pf_attack} @{toggle_attack_accessible} @{toggle_rounded_flag} {{font=@{apply_specfont_chat}@{use_specfont}}} {{scroll_desc=@{scroll-desc}}} {{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}}` const iterNum = num =&gt; num&gt;0?num+1:'' const wepID = n =&gt; `${characterName}|repeating_weapon_$${n}_` let attack = (id, num) =&gt; `{{attack${iterNum(num)}= [[ 1d20cs&gt;[[ @{${wepID(id)}crit-target} ]] + @{${wepID(id)}total-attack} ]] }}` let damage = (id, num) =&gt; `{{damage${iterNum(num)}=[[@{${wepID(id)}damage-dice-num}d@{${wepID(id)}damage-die}+@{${wepID(id)}total-damage}]]}}` let critConfirm = (id, num) =&gt; `{{crit_confirm${iterNum(num)}=[[ 1d20 + @{${wepID(id)}total-attack}+[[@{${wepID(id)}crit_conf_mod}]]]]}}` let critDamage = (id, num) =&gt; `{{crit_damage${iterNum(num)}=[[[[@{${wepID(id)}damage-dice-num}*(@{${wepID(id)}crit-multiplier}-1)]]d@{${wepID(id)}damage-die}+((@{${wepID(id)}damage_macro})*[[@{${wepID(id)}crit-multiplier}-1]])]]}}` attackName = (id, num) =&gt; `{{attack${num+1}name=@{${wepID(id)}name}}}` require('fs').writeFileSync('output.txt', head+(attackOrder.map(function(id, num) { return attack(id,num)+damage(id,num)+critConfirm(id,num)+critDamage(id,num)+attackName(id,num) }).join(' ')) ) That is some javascript (runnable with Node.js) that I used to create the macro. It works perfectly, except the last 2-5 rolls decide to not work properly randomly. A picture is worth a thousand words: These two pictures (one of them may post twice, it was being weird) were taken from the same macro/template, completely unmodified. I'm hoping someone can point out what I need to fix to make it work right. Also, any suggestions for the macro builder script (beyond what's needed to fix the original macro) would be great. I ran into a lot of weirdness trying to incorporate precision damage and bonus critical damage. Is there some "flag" I need to set to make the pseudo-iteratives I've created work properly?
Like I said, being weird. One of the pictures did not even post! So here it is, trying again, still being weird.
1542067370
vÍnce
Pro
Sheet Author
Try adding space(s) around your inline rolls " [[ " and " ]] ".&nbsp; I see that some of your inline rolls have space(great!), while other's do not.&nbsp; Roll templates and chat sometimes have issues when making lot's of simultaneous inline rolls without the extra space.&nbsp; I have no idea why. ;-P
After fixing that (and also fixing the part where I made 1d20cs&gt;[[ into 1d20cs&gt; [[ that makes it fail hardcore), it works! Thank you very much, now I can just throw around all and attack rotation I want whenever!