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

Disappearing Variables

1517874076

Edited 1517874225
When I was working on my character sheet I came across this weird bug, one of my variables. the code is as follows.     <tr>         <th></th>         <th>Str <input type='checkbox' name='attr_MentStr' value='-25'></th>         <th>Weak <input type="checkbox" name="attr_MentWeak" value="25"></th>         <th><input type="number" name="attr_TMP" value="@{R1}+@{R2}+@{R3}+@{R4}+@{R5}+@{R6}+@{R7}+@{R8}+@{R9}+@{R10}+@{MentStr}+@{MentWeak}" disabled="true"></th>     </tr> </table> <h3>Mental Break Limits</h3> <table>     <tr>         <th>Totaled points:</th>         <th>Mental Break Limit:</th>         <th>Break Chance:</th>     </tr>     <tr>         <th><input type="number" name="ign1" value="@{TMP}" disabled="true"></th>         <th><input type="number" name="attr_MSL"></th>         <th><input type="number" name="attr_MBC" value="(@{TMP}/@{MSL})*100" disabled="true"></th>     </tr> The variable TMP is defined by adding a whole bunch of variables and is displayed properly however when the variable is used as the value in 'ign1' its results is ' '. When TMP is used in the value MBC, MSL is ignored and TMP is just multiplied by 100.  For example, let TMP be 10 and MSL be 150. Ign1 would equal ' ', and MBC would equal 1000. It seems that TMP is being ignored and MSL always equals 1.  EDIT: Putting attr_ in front of ign1 fixes it not displaying. 
1517879694

Edited 1517879720
Diana P
Pro
Sheet Author
Put parenthesis around the @{TMP} and @{MBC} calls in your equation ie (@{TMP})/(@{MSL}) so you force it to calculate the sums first.  Creating the attribute does not actually add those values together; it holds the formula.  So force it to resolve the formula in the math. Hope that helps. edit:  missed a curly brace....
Thanks, Diana that fixed the problem and would help me in the future. 
1517899451
Diana P
Pro
Sheet Author
Excellent!  Happy gaming.