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

Building custom sheet, math bug or bad syntax?

I am building a character sheet for a rpg my friend made and one of the input fields is not doing the math correctly. The line is below. <td><input type="number" name="attr_defense" value="ceil(@{skillMobility}/2)+10" disabled="true" /></td> When I save the code and reload the campaign screen to look at working sheet I put 2 points into Mobility and Defense returns 12 instead of 11. Is my syntax wrong or is the math bugged?
I solved my problem. The value of skillMobility is equal to the sum of two other variables, skillMobilityMod and skillMobilityLevel. When I enclosed these in parentheses Defense started returning the correct numbers. So it was bad syntax, as ussual. XP
1404784738
Lithl
Pro
Sheet Author
API Scripter
You're not the first person to run into this. Just remember that whenever you use one attribute in the value of another, the full text of the first is substituted in place, rather than calculating the first value and substituting the result.