
I have some characteristics, let's say STR and INT but there will be more, which get summed up from a few attributes, but most importantly for this question "attr_str_base" and "attr_int_base". Whenever someone changes the "base" I want to update the associated xpcost, so "attr_str_xpcost" and "att_int_xpcost". I can handle the change for one of them: on("change:str_base", function() { getAttrs(["str_base"], function(pvalue) { var newXpCost = calcAttributeCost(parseInt(pvalue.str_base), 30); setAttrs({str_xpcost: newXpCost}); }); }); But I would really like to be able to handle them all in one "on("change:whatever") handler. I think I've got about half of the concept down but I'm missing part of it. I can use the "eventInfo" object to find out which attr changed. on("change:str_base change:int_base *etc*", function(eventInfo) { getAttrs([eventInfo.sourceAttribute], function(pvalue) { var newXpCost = calcAttributeCost(parseInt(********), 30); setAttrs(*******); } But how do I get the actual value from "pvalue" if I don't know the name of the attr? And how can I construct an object with a property that has a name of the eventInfo.sourceAttribute and the value of newXpCost. Something like "{eventInfo.sourceAttribute: newXpCost}"? Should I be using repeating structures for this? Or is there some other way I should go about this? I'm a newb to roll20 character sheets and have some javascript experience but probably only enough to make myself dangerous. If this isn't the best place for this kind of question please let me know where I should go.