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

[Help] Long macros blowing up rolltemplates

1446751102

Edited 1446751741
chris b.
Pro
Sheet Author
API Scripter
Not sure if this is pathfinder sheet specific or not. When I put too many things into a roll template it seems to quit parsing early. I have macros that roll skill checks for all characters at once (such as perception, to see if anyone notices anything) I have &nbsp;8 characters (6 players, two have animals with them). If I use one rolltemplate to display them all then near the bottom it will usually blow up like the picture below. But if I split it up into 2 (now 3) templates, then it works fine. I do not think it is a bug in the rolltemplate itself, since it only blows up most of the time. And it does this at different points near the bottom, and sometimes it works perfectly, like the parser just "gives up" when it gets tired. When it does, it prints out the calculations used in the character sheet. Question: anyone have any idea what is causing this? Image of error: Here is my macro: &{template:pf_generic}{{character_name=Perception }}{{Barnabas=[[1d20+[[@{Barnabas Collins|Perception}]]]] }}{{JarJar=[[1d20+[[@{Jar Jar|Perception}]]]] }}{{Kole=[[1d20+[[@{Kole Ash|Perception}]]]] }}{{Kraven=[[1d20+[[@{Kraven|Perception}]]]] }}{{Nelson=[[1d20+[[@{Nelson|Perception}]]]] }}{{Thade=[[1d20+[[@{Thade|Perception}]]]] }}{{Attar=[[1d20+[[@{Attar|Perception}]]]] }}{{Rocky=[[1d20+[[@{Rocky|Perception}]]]]}} I also tried "splitting" up the macro like this, which allows multiple macros to be called but still use one template. In case the problem was a function of the macro. &{template:pf_generic}{{character_name=Perception }}{{Barnabas=[[1d20+[[@{Barnabas Collins|Perception}]]]] }}{{JarJar=[[1d20+[[@{Jar Jar|Perception}]]]] }}{{Kole=[[1d20+[[@{Kole Ash|Perception}]]]] }}{{Kraven=[[1d20+[[@{Kraven|Perception}]]]] }}{{Nelson=[[1d20+[[@{Nelson|Perception}]]]] }}{{Thade=[[1d20+[[@{Thade|Perception}]]]] }}{{Attar=[[1d20+[[@{Attar|Perception}]]]] }}{{Rocky=[[1d20+[[@{Rocky|Perception}]]]]}} in the end it only works via 3 macros like this, this never breaks: &{template:pf_generic}{{character_name=Perception }}{{Barnabas=[[1d20+[[@{Barnabas Collins|Perception}]]]] }}{{JarJar=[[1d20+[[@{Jar Jar|Perception}]]]] }} &{template:pf_generic} {{Kole=[[1d20+[[@{Kole Ash|Perception}]]]] }}{{Kraven=[[1d20+[[@{Kraven|Perception}]]]] }}{{Nelson=[[1d20+[[@{Nelson|Perception}]]]] }}{{Thade=[[1d20+[[@{Thade|Perception}]]]] }} &{template:pf_generic}{{Attar=[[1d20+[[@{Attar|Perception}]]]] }}{{Rocky=[[1d20+[[@{Rocky|Perception}]]]]}} but that looks like this, which I don't prefer, since it is obviously 3 rolltemplates with spaces between: The rolltemplate is pretty simple: &lt;rolltemplate&gt; &lt;table&gt; &lt;tr&gt;&lt;td colspan="2"&gt; &lt;div&gt; &lt;span&gt; {{#character_name}} {{#character_id}}[{{character_name}}]( <a href="http://journal.roll20.net/character/{{character_id}}){{/character_id}}" rel="nofollow">http://journal.roll20.net/character/{{character_id}}){{/character_id}}</a> {{^character_id}}{{character_name}}{{/character_id}} {{#name}}:{{/name}} {{/character_name}} {{#name}} {{#name_link}}[{{name}}]({{name_link}}){{/name_link}} {{^name_link}}{{name}}{{/name_link}} {{/name}} &lt;/span&gt; &lt;span&gt; {{#header_image}}{{header_image}}{{/header_image}} &lt;/span&gt; &lt;/div&gt; &lt;/td&gt;&lt;/tr&gt; {{#subtitle}}&lt;tr&gt;&lt;td colspan="2"&gt;&lt;div&gt;&lt;span&gt;{{subtitle}}&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;{{/subtitle}} {{#allprops() header_image character_name character_id name_link subtitle description}} &lt;tr&gt;&lt;td&gt;{{key}}&lt;/td&gt;&lt;td&gt;{{value}}&lt;/td&gt;&lt;/tr&gt; {{/allprops() header_image character_name character_id name_link subtitle description}} {{#description}} &lt;tr&gt;&lt;td colspan="2" style="font-size:.90em; font-weight:normal;"&gt;{{description}}&lt;/td&gt;&lt;/tr&gt; {{/description}} &lt;/table&gt; &lt;/rolltemplate&gt;
You won't have this problem with PowerCards.... ^_~
1446757448

Edited 1446757545
vÍnce
Pro
Sheet Author
+1 HB You can also add space around your inline-rolls. &nbsp;For some reason roll templates that include lot's inline's within them often break and output some of the formula instead of the results. &nbsp;I got that tip from HB. &nbsp;;-) so add a space before and after double brackets... " [[ " and " ]] "
1446775789
chris b.
Pro
Sheet Author
API Scripter
that was it Vince, thanks! Funny thing I kept thinking it was the length of the macro, and so kept deleting spaces.
Yeah, I've fixed a lot of "bugs" with api scripts by adding a space somewhere. It's weird.
1446791069
vÍnce
Pro
Sheet Author
Cool beans.