Ok, I've run into another problem... I'm trying to update an Ability, and I thought I knew how to do it, but...apparently not. Here's my code: on("change:attribute", function(obj){
var aName = obj.get('name'),
cID = obj.get('characterid'),
aValue = obj.get('current');
log("aName: " + aName);
if (aName == 'is_npc' && aValue == '1') {
log("### Character Sheet Type Changed ###");
log("### Need to update Token Actions ###");
var updateAgility = findObjs({
_type: "ability",
_characterid: cID,
name: "Agility"});
log(updateAgility);
updateAgility.set({action: "@{skillrt} @{defsTemplate} @{rolltmAgility}"});
}
});
From what I've seen in other scripts, I thought it was the .set that would update the ability, but I keep getting an error message: TypeError: updateAgility.set is not a function
at apiscript.js:1343:23
at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:105:34), <anonymous>:65:16)
at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:105:34), <anonymous>:70:8)
at TrackedObj.set (/home/node/d20-api-server/api.js:704:14)
at updateLocalCache (/home/node/d20-api-server/api.js:933:18)
at /home/node/d20-api-server/api.js:1076:11
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425)
So...what am I doing wrong on this one? I've seen in the documentation that I can create an object and remove an object, but there doesn't seem to be an update function, but I've seen in other scripts that this seems to be possible, but...I'm missing something.