The roll20 repository you refer to there at 1.43 is the official version. Thats the version that people get in game. Which official sheet are you referring to? If its got updates beyond your sheet, its best not to combine them without examining the differences, and if it is dependent on power cars, it shouldnt be merged. That would make the sheet inaccessible to free users, who iwll make up the bulk of the people using the sheet. I had a quick look at the sheet workers and I see you've been using eval in places. That's never a good idea. There's probably little damage it can do here, but you'd be best off with replacing it with parseInt, parseFloat, or Number, to convert those values to proper numbers. Here's a streamlined version of that sheet worker that uses all the evals, if you want to use it: on("change:sta change:stamod change:hp_lv0 change:hp_lv1 change:hp_lv2 change:hp_lv3 change:hp_lv4 change:hp_lv5 change:hp_lv6 change:hp_lv7 change:hp_lv8 change:hp_lv9 change:hp_lv10", function() { getAttrs(["staMod","HP_LV0","HP_LV1","HP_LV2","HP_LV3","HP_LV4","HP_LV5","HP_LV6","HP_LV7","HP_LV8","HP_LV9","HP_LV10"], function(values) { const staMod_local = parseInt(values.staMod) || 0;
console.log("Stamina Modifier is " + staMod_local);
// let is a more modern version of var, it has some differences but none relevant here.
let hp_current_local = 0; // go through the levels in a loop. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].forEach(num => {
// get hit points for the current level
// const is like var, but used only for variables that will not change
const hp_level = parseInt(values[`HP_LV${num}`]) || 0; if(hp_level > 0) {
// whenever calculating values more than once, put it in a variable
const level_increase = Math.max(1, hp_level + staMod_local);
// construct the string using template literal syntax - this allows you to use variables inside ${}
console.log(`Level ${num} HP with StaMod = ${level_increase}`);
// += is anotehr way to do "hp_current_local = hp_current_local +" but is a lot more compact
hp_current_local += level_increase; } else { console.log(`HP at Level ${num} are not valid and not counted as part of the Current HP calculation`); } }); setAttrs({ CalcCurMaxHP: hp_current_local, HPmax: hp_current_local }); }); });