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

Is there a limit of innline operations for this Macro?

I was working on this Macro-template. (Working formula) /w gm &{template:default} {{name=Modifiers **A:(?{A|}) D:(?{D|})**}} {{Variant1= [[[[?{A|}-1]] * [[?{D|}]] [[-1]]]]}} {{Variant2= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}-1]]]]}} {{Variant3= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}]]]]}} But  when I tried to add another operation to the formula, [[[[?{A|}-1]] * [[?{D|}]]]]  It broke. (Not Working formula) /w gm &{template:default} {{name=Modifiers **A:(?{A|}) D:(?{D|})**}} {{Variant1= [[[[?{A|}-1]] * [[?{D|}]] [[-1]]]]}} {{Variant2= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}-1]]]] [[[[?{A|}-1]] * [[?{D|}]]]]}} {{Variant3= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}]]]]}} After trying many different things (Checking if it was syntax/query/positioning problem, etc). I discovered that by adding any other ( in -inline operation) to the formula, the macro breaks. (Example) {{Test= [[[[1]]+[[2]]]]}} /w gm &{template:default} {{name=Modifiers **A:(?{A|}) D:(?{D|})**}} {{Variant1= [[[[?{A|}-1]] * [[?{D|}]] [[-1]]]]}} {{Variant2= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}-1]]]]}} {{Variant3= [[[[?{A|}-1]] * [[?{D|}]]-[[1]] + [[?{A|}]]]]}} {{Test= [[[[1]]+[[2]]]]}} ________________________________________ To clarify : If is a normal in-line operation it works just fine. (Example) {{Test= [[1]]+[[2]]}} {{Test= [[1 + 2]]}} Is this a known issue ? Am I missing something ? Please let me know if there is a solution where I can keep the content of the (Not Working) formula in the same macro.
1653008252
vÍnce
Pro
Sheet Author
I would try adding space between your inline rolls.  from this [[X]] to [[ X ]].  Sounds silly, but we experienced similar issues with the pathfinder community sheet when iterative attacks were introduced.
1653046162

Edited 1653046213
GiGs
Pro
Sheet Author
API Scripter
A large number of inline rolls does cause a macro to lag badly, even when they are all working properly. I'd look to see if you can remove some of the inline rolls from that expression. I'm thinking some of your inline rolls can be replaced by simple parenthesis.
1653046431

Edited 1653046640
GiGs
Pro
Sheet Author
API Scripter
Also when looking at your code, it looks to me like this contains an error: {{Variant1= [[[[?{A|}-1]] * [[?{D|}]] [[-1]]]]}} That last -1 doesnt need to be in an inline roll, and should that be (?{d}-1) ? Assuming the expression is correct, you can streamline it to: {{Variant1= [[ (?{A}-1) * ?{D} -1 ]] }}
1653047175
GiGs
Pro
Sheet Author
API Scripter
My first pass at your non-working formula (you'll want to check syntax): /w gm &{template:default} {{name=Modifiers **A:(?{A|0}) D:(?{D|0})**}} {{Variant1= [[ (?{A}-1) * ?{D} -1 ]] }} {{Variant2= [[ (?{A}-1) * ?{D}-1 + (?{A}-1)]] [[(?{A}-1) * ?{D}]]}} {{Variant3= [[ (?{A}-1) * ?{D}-1 + ?{A} ]]}}
GiGs said: A large number of inline rolls does cause a macro to lag badly, even when they are all working properly. I'd look to see if you can remove some of the inline rolls from that expression. I'm thinking some of your inline rolls can be replaced by simple parenthesis. Yes , that was one of the assumptions I had in mind at  some point  but I didn't exactly know how to work with simple parenthesis without ruinning the whole code due to my lack of experience. GiGs said: Also when looking at your code, it looks to me like this contains an error: {{Variant1= [[[[?{A|}-1]] * [[?{D|}]] [[-1]]]]}} That last -1 doesnt need to be in an inline roll, and should that be (?{d}-1) ? Assuming the expression is correct, you can streamline it to: {{Variant1= [[ (?{A}-1) * ?{D} -1 ]] }} Yes you are right, at some point I also tried to remove that unnecesary [[-1]] but since it didn't solve the whole problem I forgot to save that change later. Thanks for pointing it out. The expression is correct by the way, I did intend to to do that formula ((A - 1) * (D)) -1 GiGs said: My first pass at your non-working formula (you'll want to check syntax): /w gm &{template:default} {{name=Modifiers **A:(?{A|0}) D:(?{D|0})**}} {{Variant1= [[ (?{A}-1) * ?{D} -1 ]] }} {{Variant2= [[ (?{A}-1) * ?{D}-1 + (?{A}-1)]] [[(?{A}-1) * ?{D}]]}} {{Variant3= [[ (?{A}-1) * ?{D}-1 + ?{A} ]]}} It works great. Thank you for taking the time to solve the problem. I learned a few things that will let me improve
1653085967
GiGs
Pro
Sheet Author
API Scripter
That's great :) Inline rolls are lag-heavy, and it's best to keep the number of them as low as you can get away with.