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

Custom character sheet HTML maths functions?

Unsure if this is the right topic but it seemed to make the most sense. So I'm currently making a custom character sheet and one of the sections in it is about 20% max health. Is there any way to make it work it out 20% max health automatically using HTML or will players just have to do it manually and write it in? I appreciate that is isn't hard to work out 20% but it'd be nice to make the sheet do it. It's been years since I used HTML so it's been a bit of a rollercoaster lol Thanks in advance :)
1496708142

Edited 1496708232
This would be best done with a sheet worker script <input type="text" name="attr_health_max" value="0"> <input type="text" name="attr_health_max_20_percent" value="0" readonly> <script type="text/worker"> on("sheet:opened change:health_max", function() {   getAttrs(["health_max"], function(values) {     setAttrs({       "health_max_20_percent": Math.floor((parseInt(values["health_max"],10) || 0) / 5)     });   }); }); </script>
Rebekah V. said: Is there any way to make it work it out 20% max health automatically using HTML This is the straight html way. <input type="text" name="attr_health_max" value="" /> <input type="text" name="attr_health_max_20_percent" value="@{health_max} * 0.2" disabled="true"/>