I wrote a quick bit of code to dig into this, as suggested by @Silvyre. Code is here: function processCommand(evt) {
const [command, ...args] = evt.content.split(' ');
debug(`${evt.who} sent ${command}${args ? ' ' + args.join(' ') : null}.`);
switch (command) {
case '!shapechanger': shapechange(evt); break;
case '!resize': resize(evt, args); break;
case '!follow': follow(evt, ...args); break;
case '!debug': debugTokenProperties(evt, ...args); break;
case '!searchForTokenAnomalies': searchForTokenAnomalies(evt, ...args); break;
case '!cleanupTokenAnomalies': cleanupTokenAnomalies(evt, ...args); break;
}
}
function debugTokenProperties (evt, selectedId) {
const tokens = getSelectedTokens(evt);
tokens.forEach((token) => {
const represents = token.get('represents');
const name = token.get('name');
debug(`Token For ${name} (${represents})`);
const attributes = getAllSheetAttributes(represents);
attributes.forEach((attribute) => {
const attrName = attribute.get('name');
debug(` - ${attrName}`);
})
});
}
function searchForTokenAnomalies (evt, selectedId) {
const tokens = getSelectedTokens(evt);
tokens.forEach((token) => {
const represents = token.get('represents');
const name = token.get('name');
debug(`Token For ${name} (${represents})`);
const attributes = getAllSheetAttributes(represents);
attributes
.map((attribute) => attribute.get('name'))
.filter(filterAnomalousAttributes)
.forEach((attribute) => {
const attrObj = getSheetAttribute(represents, attribute);
const value = attrObj.get('current');
debug(` - ${attribute}: ${value}`);
});
});
}
function cleanupTokenAnomalies (evt, selectedId) {
const tokens = getSelectedTokens(evt);
tokens.forEach((token) => {
const represents = token.get('represents');
const name = token.get('name');
debug(`Token For ${name} (${represents})`);
const attributes = getAllSheetAttributes(represents);
attributes
.map((attribute) => attribute.get('name'))
.filter(filterAnomalousAttributes)
.forEach((attribute) => {
const attrObj = getSheetAttribute(represents, attribute);
attrObj.remove();
debug(` - removed: ${attribute}`);
});
});
}
function filterAnomalousAttributes (attribute) {
return (/pb$/i.test(attribute) || /(.*?)_(bonus$|save_bonus$|mod$|mod_with_sign$|mod_formula$)/i.test(attribute));
} Plus some utility functions for getting tokens and their attributes. This resulted in the following output: "[2017-09-04T18:42:09.500Z] DM (GM) sent !searchForTokenAnomalies ." "[2017-09-04T18:42:09.501Z] Token For Willa (-KUATNG1WvzEaNVKYmYE)" "[2017-09-04T18:42:09.514Z] - pb: 2" "[2017-09-04T18:42:09.520Z] - h_PB: 1" "[2017-09-04T18:42:09.525Z] - strength_saving_throw_mod: -1[str] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.532Z] - strength_saving_throw_mod_with_sign: -1" "[2017-09-04T18:42:09.537Z] - dexterity_saving_throw_mod: 3[dex] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.545Z] - dexterity_saving_throw_mod_with_sign: +3" "[2017-09-04T18:42:09.549Z] - constitution_saving_throw_mod: 0[con] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.555Z] - constitution_saving_throw_mod_with_sign: +0" "[2017-09-04T18:42:09.560Z] - intelligence_saving_throw_mod: 1[int] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.566Z] - intelligence_saving_throw_mod_with_sign: +1" "[2017-09-04T18:42:09.572Z] - wisdom_saving_throw_mod: 1[wis] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.578Z] - wisdom_saving_throw_mod_with_sign: +1" "[2017-09-04T18:42:09.585Z] - charisma_saving_throw_mod: 3[cha] + 0[global saving throw bonus]" "[2017-09-04T18:42:09.592Z] - charisma_saving_throw_mod_with_sign: +3" "[2017-09-04T18:42:09.597Z] - fortitude_saving_throw_mod: 0[global saving throw bonus]" "[2017-09-04T18:42:09.605Z] - fortitude_saving_throw_mod_with_sign: +0" "[2017-09-04T18:42:09.611Z] - reflex_saving_throw_mod: 0[global saving throw bonus]" "[2017-09-04T18:42:09.616Z] - reflex_saving_throw_mod_with_sign: +0" "[2017-09-04T18:42:09.621Z] - will_saving_throw_mod: 0[global saving throw bonus]" "[2017-09-04T18:42:09.627Z] - will_saving_throw_mod_with_sign: +0" "[2017-09-04T18:42:09.631Z] - strength_mod: -1" "[2017-09-04T18:42:09.637Z] - strength_mod_with_sign: -1" "[2017-09-04T18:42:09.642Z] - strength_check_mod: -1" "[2017-09-04T18:42:09.647Z] - strength_check_mod_with_sign: -1" "[2017-09-04T18:42:09.652Z] - strength_check_mod_formula: -1[str mod with bonus] + (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.658Z] - finesse_mod: 3" "[2017-09-04T18:42:09.662Z] - dexterity_mod: 3" "[2017-09-04T18:42:09.667Z] - dexterity_mod_with_sign: +3" "[2017-09-04T18:42:09.672Z] - dexterity_check_mod: 3" "[2017-09-04T18:42:09.676Z] - dexterity_check_mod_with_sign: +3" "[2017-09-04T18:42:09.681Z] - dexterity_check_mod_formula: 3[dex mod with bonus] + (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.689Z] - constitution_mod: 0" "[2017-09-04T18:42:09.695Z] - constitution_mod_with_sign: +0" "[2017-09-04T18:42:09.700Z] - constitution_check_mod: 0" "[2017-09-04T18:42:09.704Z] - constitution_check_mod_with_sign: +0" "[2017-09-04T18:42:09.709Z] - constitution_check_mod_formula: (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.714Z] - intelligence_mod: 1" "[2017-09-04T18:42:09.720Z] - intelligence_mod_with_sign: +1" "[2017-09-04T18:42:09.725Z] - intelligence_check_mod: 1" "[2017-09-04T18:42:09.730Z] - intelligence_check_mod_with_sign: +1" "[2017-09-04T18:42:09.734Z] - intelligence_check_mod_formula: 1[int mod with bonus] + (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.739Z] - wisdom_mod: 1" "[2017-09-04T18:42:09.744Z] - wisdom_mod_with_sign: +1" "[2017-09-04T18:42:09.749Z] - wisdom_check_mod: 1" "[2017-09-04T18:42:09.754Z] - wisdom_check_mod_with_sign: +1" "[2017-09-04T18:42:09.760Z] - wisdom_check_mod_formula: 1[wis mod with bonus] + (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.764Z] - charisma_mod: 3" "[2017-09-04T18:42:09.769Z] - charisma_mod_with_sign: +3" "[2017-09-04T18:42:09.775Z] - charisma_check_mod: 3" "[2017-09-04T18:42:09.780Z] - charisma_check_mod_with_sign: +3" "[2017-09-04T18:42:09.785Z] - charisma_check_mod_formula: 3[cha mod with bonus] + (@{global_check_bonus})[global check bonus]" "[2017-09-04T18:42:09.793Z] - charisma_bonus: 1" "[2017-09-04T18:42:09.801Z] - wisdom_bonus: 0" "[2017-09-04T18:42:09.812Z] - charisma_save_bonus: " "[2017-09-04T18:42:09.819Z] - dexterity_save_bonus: " "[2017-09-04T18:42:09.826Z] - constitution_save_bonus: " "[2017-09-04T18:42:09.832Z] - wisdom_save_bonus: " "[2017-09-04T18:42:09.840Z] - intelligence_save_bonus: " "[2017-09-04T18:42:09.845Z] - strength_save_bonus: " "[2017-09-04T18:42:09.853Z] - dexterity_bonus: 2" "[2017-09-04T18:42:09.863Z] - d20_mod: ro<1" "[2017-09-04T18:42:09.882Z] - npcd_str_mod: (-1)" "[2017-09-04T18:42:09.888Z] - npcd_dex_mod: (+0)" "[2017-09-04T18:42:09.894Z] - npcd_con_mod: (+1)" "[2017-09-04T18:42:09.899Z] - npcd_int_mod: (+1)" "[2017-09-04T18:42:09.904Z] - npcd_wis_mod: (+3)" "[2017-09-04T18:42:09.908Z] - npcd_cha_mod: (+3)" "[2017-09-04T18:42:20.917Z] DM (GM) sent !cleanupTokenAnomalies ." "[2017-09-04T18:42:20.918Z] Token For Willa (-KUATNG1WvzEaNVKYmYE)" "[2017-09-04T18:42:20.938Z] - removed: pb" "[2017-09-04T18:42:20.948Z] - removed: h_PB" "[2017-09-04T18:42:20.958Z] - removed: strength_saving_throw_mod" "[2017-09-04T18:42:20.968Z] - removed: strength_saving_throw_mod_with_sign" "[2017-09-04T18:42:20.979Z] - removed: dexterity_saving_throw_mod" "[2017-09-04T18:42:20.988Z] - removed: dexterity_saving_throw_mod_with_sign" "[2017-09-04T18:42:20.998Z] - removed: constitution_saving_throw_mod" "[2017-09-04T18:42:21.008Z] - removed: constitution_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.018Z] - removed: intelligence_saving_throw_mod" "[2017-09-04T18:42:21.028Z] - removed: intelligence_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.038Z] - removed: wisdom_saving_throw_mod" "[2017-09-04T18:42:21.046Z] - removed: wisdom_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.055Z] - removed: charisma_saving_throw_mod" "[2017-09-04T18:42:21.064Z] - removed: charisma_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.073Z] - removed: fortitude_saving_throw_mod" "[2017-09-04T18:42:21.081Z] - removed: fortitude_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.092Z] - removed: reflex_saving_throw_mod" "[2017-09-04T18:42:21.102Z] - removed: reflex_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.113Z] - removed: will_saving_throw_mod" "[2017-09-04T18:42:21.123Z] - removed: will_saving_throw_mod_with_sign" "[2017-09-04T18:42:21.131Z] - removed: strength_mod" "[2017-09-04T18:42:21.139Z] - removed: strength_mod_with_sign" "[2017-09-04T18:42:21.151Z] - removed: strength_check_mod" "[2017-09-04T18:42:21.161Z] - removed: strength_check_mod_with_sign" "[2017-09-04T18:42:21.173Z] - removed: strength_check_mod_formula" "[2017-09-04T18:42:21.182Z] - removed: finesse_mod" "[2017-09-04T18:42:21.192Z] - removed: dexterity_mod" "[2017-09-04T18:42:21.201Z] - removed: dexterity_mod_with_sign" "[2017-09-04T18:42:21.212Z] - removed: dexterity_check_mod" "[2017-09-04T18:42:21.221Z] - removed: dexterity_check_mod_with_sign" "[2017-09-04T18:42:21.234Z] - removed: dexterity_check_mod_formula" "[2017-09-04T18:42:21.244Z] - removed: constitution_mod" "[2017-09-04T18:42:21.252Z] - removed: constitution_mod_with_sign" "[2017-09-04T18:42:21.267Z] - removed: constitution_check_mod" "[2017-09-04T18:42:21.279Z] - removed: constitution_check_mod_with_sign" "[2017-09-04T18:42:21.288Z] - removed: constitution_check_mod_formula" "[2017-09-04T18:42:21.297Z] - removed: intelligence_mod" "[2017-09-04T18:42:21.307Z] - removed: intelligence_mod_with_sign" "[2017-09-04T18:42:21.315Z] - removed: intelligence_check_mod" "[2017-09-04T18:42:21.323Z] - removed: intelligence_check_mod_with_sign" "[2017-09-04T18:42:21.331Z] - removed: intelligence_check_mod_formula" "[2017-09-04T18:42:21.341Z] - removed: wisdom_mod" "[2017-09-04T18:42:21.354Z] - removed: wisdom_mod_with_sign" "[2017-09-04T18:42:21.362Z] - removed: wisdom_check_mod" "[2017-09-04T18:42:21.370Z] - removed: wisdom_check_mod_with_sign" "[2017-09-04T18:42:21.378Z] - removed: wisdom_check_mod_formula" "[2017-09-04T18:42:21.386Z] - removed: charisma_mod" "[2017-09-04T18:42:21.394Z] - removed: charisma_mod_with_sign" "[2017-09-04T18:42:21.403Z] - removed: charisma_check_mod" "[2017-09-04T18:42:21.411Z] - removed: charisma_check_mod_with_sign" "[2017-09-04T18:42:21.420Z] - removed: charisma_check_mod_formula" "[2017-09-04T18:42:21.428Z] - removed: charisma_bonus" "[2017-09-04T18:42:21.436Z] - removed: wisdom_bonus" "[2017-09-04T18:42:21.445Z] - removed: charisma_save_bonus" "[2017-09-04T18:42:21.454Z] - removed: dexterity_save_bonus" "[2017-09-04T18:42:21.463Z] - removed: constitution_save_bonus" "[2017-09-04T18:42:21.471Z] - removed: wisdom_save_bonus" "[2017-09-04T18:42:21.479Z] - removed: intelligence_save_bonus" "[2017-09-04T18:42:21.489Z] - removed: strength_save_bonus" "[2017-09-04T18:42:21.497Z] - removed: dexterity_bonus" "[2017-09-04T18:42:21.514Z] - removed: d20_mod" "[2017-09-04T18:42:21.525Z] - removed: npcd_str_mod" "[2017-09-04T18:42:21.537Z] - removed: npcd_dex_mod" "[2017-09-04T18:42:21.547Z] - removed: npcd_con_mod" "[2017-09-04T18:42:21.554Z] - removed: npcd_int_mod" "[2017-09-04T18:42:21.567Z] - removed: npcd_wis_mod" "[2017-09-04T18:42:21.578Z] - removed: npcd_cha_mod" "[2017-09-04T18:44:19.592Z] DM (GM) sent !searchForTokenAnomalies ." "[2017-09-04T18:44:19.593Z] Token For Willa (-KUATNG1WvzEaNVKYmYE)" And now, after reattempting to roll History ... nothing has changed. It's still rolling at +5 despite showing +7 on the sheet.