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

[5e OGL] Change Attribute Mod calculations?

How are the attribute mods calculated on the 5e OGL sheet? I've looked at the HTML and I can't find where there's a formula that translates a 16 Strength into a mod of 3. I am interested in changing the formula for a homebrew 5e game, but I can't figure out how to do so. The formula I'd like to use is Mod=(BaseAttr - 10), not the current Mod=(BaseAttr - 10)/2. So a score of 14 would be +4 under my formula, not a +2.
That would require grabbing the character sheet code from the github and modify the following code and using the custom sheet option in the game settings. var update_mod = function (attr) { getAttrs([attr], function(v) { var attr_abr = attr.substring(0,3); var finalattr = v[attr] && isNaN(v[attr]) === false ? Math.floor((parseInt(v[attr], 10) - 10) / 2) : 0; var update = {}; update[attr + "_mod"] = finalattr; update["npc_" + attr_abr + "_negative"] = v[attr] && !isNaN(v[attr]) && parseInt(v[attr], 10) < 10 ? 1 : 0; setAttrs(update); }); };
Awesome, thank you. I got as far as adding it as a custom sheet and was looking at the HTML and couldn't figure out where I should be looking for the calculations. I know rudimentary HTML and even less CSS. :) Is that  *Workers* section javascript? I'm not familiar with that code.
Yes, this is in the sheetworkers (javascript) portion of the code.
I found the Roll20 Wiki about Sheet Worker Scripts. Should be interesting. Thanks again!