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

Auto Calculator Problem

1629278676

Edited 1629278834
I have an issue with Autocalculations for my Template roll. It throws out a string of text instead of doing a formula. The line under "Attack:" is {{dmg1=[[50 + [[1d4]]]]}} {{dmgcrit1=[[floor(50+[[1d4]]*1.5)]]}}. The additional brackets in the picture are from template itself and do not affect formula. dmg1 is done no problem, but the dmgcrit1 is doing only 1d4 and the rest is string of text. If I paste [[floor((50 + [[1d4]])*1.5)]] into the textbox it does the whole calculation no problem. Any ideas how to fix it? Thanks in advance!
1629281451

Edited 1629281498
GiGs
Pro
Sheet Author
API Scripter
In the screenshot there's a parenthesis outside the floor function that isn't in your expression, which suggests your character sheet is interacting with the rolltemplate code. So we might need to know which sheet it is to figure out a solution. Having said that, the output doesn't match your expression above: the screenshot has this: floor((50+[[1d4]])*1.5) but your expression above has floor(50+[[1d4]]*1.5) They aren't the same expressions (the second one is missing a set of inner parentheses). Why the discrepancy? When you say it works when you paste the code into the textbox, which textbox are you referring to?
1629282095

Edited 1629282339
As mentioned, the outside parenthesis are a part of rolltemplate as shown below. I did try it without them and it didnt help. <div> {{dmg1}} ({{dmgcrit1}}) <span class="tcat">{{dmgtype1}} Damage</span> </div> The mistake on the screenshot is on my part, i copied the wrong text. This is how the formula looks like, so there are double parenthesis. The single one was from me fiddling around with it. {{dmg1=[[50 + [[1d4]]]]}} {{dmgcrit1=[[floor((50 + [[1d4]])*1.5)]]}} So again, [[floor((50 + [[1d4]])*1.5)]] works fine in the text box, but not in the rolltemplate. Edit. Just a note, that if I remove [[1d4]] so {{dmgcrit1=[[floor((50)*1.5)]]}}, it works fine.
1629283280
GiGs
Pro
Sheet Author
API Scripter
There's stuff in my post you havent clarified, and I am not going to be able to help much without those answers (as well as seeing the whole rolltemplate probably, and the whole roll expression you are sending to the rolltemplate). That said, have you tried this [[floor((50 + 1d4)*1.5)]] You shouldnt need double brackets around the d4, since you have double brackets around the whole thing - that d4 will be rolled.
Well, that fixed everything. It does work without the second set of brackets and it does the 1d4 roll. I guess that would be that. Thanks a lot of the help!
1629285238

Edited 1629285322
GiGs
Pro
Sheet Author
API Scripter
Great! You can simplify that earlier roll too {{dmg1=[[50 + 1d4]]}} It's a good idea to keep the number [[ ]] as low as possible, because they can take time to process and longer chains of them can add a noticeable delay.