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

[Character Sheet] Wrong Auto-Calculation

I'm working on implant my own game system to Roll20 and I encouter a strange behavior when I reference a auto-calculate fields to another. I have two auto-c fields : attr_TankMass and attr_TankAgility. attr_TankMass is a sum of many fields accross the sheet, with this formula : @{TankHullMass}+@{TankEngineMass}+@{TankTurretMass}+@{TankGunMass}+((@{TankHullAmmo}*@{TankShellWeight})/1000)+((@{TankTurretAmmo}*@{TankShellWeight})/1000) attr_TankAgility is the result of the following formula : round(@{TankEnginePower}/@{TankMass}) With this input : attr_TankHullMass = 42.71 attr_TankEngineMass = 0.85 attr_TankTurretMass = 8.25 attr_TankGunMass = 2.05 attr_TankHullAmmo = 60 attr_TankTurretAmmo = 36 attr_TankShellWeight = 17.5 attr_TankEnginePower = 650 I got : attr_TankMass = 55.54 attr_TankAgility = 28 TankMass is correct, as expected. I'm a not a international famous mathematician but I'm pretty sure 650/55.54 is equal to 11.7. Not 28.
Adding parenthesis around the TankMass formula fixed the miss calculation. (@{TankHullMass}+@{TankEngineMass}+@{TankTurretMass}+@{TankGunMass}+((@{TankHullAmmo}*@{TankShellWeight})/1000)+((@{TankTurretAmmo}*@{TankShellWeight})/1000)) I add the tip to the wiki. (Topic can be mark as solved)