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 .
×

Value within on Custom Character Sheet not calculating correctly

1599751434

Edited 1599751664
Hi! I am having trouble getting a value to calculate correctly within an <input> on a custom character sheet. What is frustrating is that I wrote the code, tested it twice and it worked. When I went back to the code to copy and paste it into other areas, it is no longer working. Below is a pic I get in the roll20 game as well as the code below. The value in question is in bold. Any help is greatly appreciated!     <div class="Acro">                <label class="Acrobatics">Acrobatics             <button type="roll" value="/em tests his ``Acrobatics!`` [[1d20cs>@{Acrobatics_max}+@{Acrobatics}]]" name="roll_Acrobatics"></button>             <input type="number" name="attr_AcroMod" value="floor(@{Finesse}/2)" disabled="true"/>            <input type="number" name="attr_AcroProf" value="floor(@{AcroSuccess}/3)" disabled="true"/>            <input type="number" name="attr_AcroMisc" value="0"><input type="number" name="attr_AcroSuccess" value="0"/>            <input type="number" name="attr_Acrobatics" value="@{AcroMod}+@{AcroProf}+@{AcroMisc}" disabled="true"/>            <input hidden type="number" name="attr_Acrobatics_max"  value="((15+@{AcroMod})-(@{Acrobatics}))"   disabled="true"/>        </label>     </div>
1599754158
Kraynic
Pro
Sheet Author
Since there is a calculation involved, I think you might need another set of brackets to make sure the cs calculation resolves to a number before the roll is compared to it.&nbsp; [[1d20cs&gt;[[@{Acrobatics_max}+@{Acrobatics}]]]] Have you thought about using sheetworkers to generate those values?&nbsp; They would probably make for a nicer sheet (and easier macros) in the long run. <a href="https://wiki.roll20.net/Sheet_Worker_Scripts" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts</a>
1599754625
GiGs
Pro
Sheet Author
API Scripter
I would recommend doing these as a sheet worker, but I'm guessing you have a lot of skills, each with their own calculations. But it looks like they follow similar patterns. If you post the html for your entire skill section, and I can see a repeating pattern, I'll post a set of sheet workers to calculate those attributes.
GiGs said: I would recommend doing these as a sheet worker, but I'm guessing you have a lot of skills, each with their own calculations. But it looks like they follow similar patterns. If you post the html for your entire skill section, and I can see a repeating pattern, I'll post a set of sheet workers to calculate those attributes. So each skill would follow the same structure/calculations, just different names. I can still post the whole &lt;div&gt; of the skills if needed, but one template for one skill should (in theory) work for the others. Would much appreciate the help in form of a template :) thanks for the reply!
Kraynic said: Since there is a calculation involved, I think you might need another set of brackets to make sure the cs calculation resolves to a number before the roll is compared to it.&nbsp; [[1d20cs&gt;[[@{Acrobatics_max}+@{Acrobatics}]]]] Have you thought about using sheetworkers to generate those values?&nbsp; They would probably make for a nicer sheet (and easier macros) in the long run. <a href="https://wiki.roll20.net/Sheet_Worker_Scripts" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts</a> Thanks for replying! I swear I have tried all the different brackets {}, {}, (), in every spot, but I did this simple fix and yes! it worked! I believe you are correct as far as sheetworkers. I was certainly gonna dive into this part of the coding soon. I learn quick but new to HTML/CSS so took on this personal project to practice and find things out as I go. It looks as though another fellow gamer may be able to throw me a personalized template for the skills for sheetworkers. Appreciate the reply and the help! :)
1599801789

Edited 1599803853
GiGs
Pro
Sheet Author
API Scripter
Tony M. said: GiGs said: I would recommend doing these as a sheet worker, but I'm guessing you have a lot of skills, each with their own calculations. But it looks like they follow similar patterns. If you post the html for your entire skill section, and I can see a repeating pattern, I'll post a set of sheet workers to calculate those attributes. So each skill would follow the same structure/calculations, just different names. I can still post the whole &lt;div&gt; of the skills if needed, but one template for one skill should (in theory) work for the others. Would much appreciate the help in form of a template :) thanks for the reply! Please post the whole div, but maybe put it in pastebin.com and link it here, if its long. I need to see the way the other attribute names are constructed, and may recommend changing your attribute names to fit a useful pattern better. Also, is&nbsp;@{Finesse} a calculated field? If so, you'll need to post the code for the attributes too, because they'll need to be changed to sheet workers too. Sheet workers cannot work with attributes created by autocalc fields.